rubocop 0.35.1 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +164 -0
- data/LICENSE.txt +1 -1
- data/README.md +72 -21
- data/bin/rubocop +1 -0
- data/config/default.yml +167 -18
- data/config/disabled.yml +19 -6
- data/config/enabled.yml +159 -14
- data/lib/rubocop.rb +67 -26
- data/lib/rubocop/ast_node.rb +488 -14
- data/lib/rubocop/ast_node/builder.rb +24 -0
- data/lib/rubocop/ast_node/sexp.rb +13 -0
- data/lib/rubocop/cached_data.rb +58 -0
- data/lib/rubocop/cli.rb +47 -10
- data/lib/rubocop/comment_config.rb +9 -2
- data/lib/rubocop/config.rb +99 -31
- data/lib/rubocop/config_loader.rb +23 -14
- data/lib/rubocop/config_store.rb +1 -0
- data/lib/rubocop/cop/autocorrect_logic.rb +2 -1
- data/lib/rubocop/cop/commissioner.rb +3 -5
- data/lib/rubocop/cop/cop.rb +23 -17
- data/lib/rubocop/cop/corrector.rb +25 -0
- data/lib/rubocop/cop/force.rb +1 -0
- data/lib/rubocop/cop/ignored_node.rb +3 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +2 -1
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +2 -1
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +4 -3
- data/lib/rubocop/cop/lint/block_alignment.rb +29 -91
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +2 -1
- data/lib/rubocop/cop/lint/condition_position.rb +2 -1
- data/lib/rubocop/cop/lint/debugger.rb +29 -12
- data/lib/rubocop/cop/lint/def_end_alignment.rb +16 -18
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +6 -6
- data/lib/rubocop/cop/lint/duplicate_methods.rb +98 -74
- data/lib/rubocop/cop/lint/duplicated_key.rb +3 -2
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +3 -2
- data/lib/rubocop/cop/lint/else_layout.rb +2 -1
- data/lib/rubocop/cop/lint/empty_ensure.rb +2 -1
- data/lib/rubocop/cop/lint/empty_interpolation.rb +2 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +77 -39
- data/lib/rubocop/cop/lint/end_in_method.rb +2 -1
- data/lib/rubocop/cop/lint/ensure_return.rb +2 -1
- data/lib/rubocop/cop/lint/eval.rb +2 -1
- data/lib/rubocop/cop/lint/float_out_of_range.rb +31 -0
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +14 -30
- data/lib/rubocop/cop/lint/handle_exceptions.rb +2 -1
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +85 -0
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +120 -0
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +3 -1
- data/lib/rubocop/cop/lint/literal_in_condition.rb +6 -9
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +6 -9
- data/lib/rubocop/cop/lint/loop.rb +2 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +19 -3
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +38 -0
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +5 -8
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +8 -6
- data/lib/rubocop/cop/lint/rand_one.rb +36 -0
- data/lib/rubocop/cop/lint/require_parentheses.rb +6 -5
- data/lib/rubocop/cop/lint/rescue_exception.rb +3 -2
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +2 -1
- data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +6 -4
- data/lib/rubocop/cop/lint/syntax.rb +9 -5
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +3 -2
- data/lib/rubocop/cop/lint/unneeded_disable.rb +121 -18
- data/lib/rubocop/cop/lint/unreachable_code.rb +5 -4
- data/lib/rubocop/cop/lint/unused_block_argument.rb +9 -7
- data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -1
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +56 -29
- data/lib/rubocop/cop/lint/useless_assignment.rb +4 -16
- data/lib/rubocop/cop/lint/useless_comparison.rb +3 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +2 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +14 -20
- data/lib/rubocop/cop/lint/void.rb +10 -11
- data/lib/rubocop/cop/metrics/abc_size.rb +3 -1
- data/lib/rubocop/cop/metrics/block_nesting.rb +2 -1
- data/lib/rubocop/cop/metrics/class_length.rb +1 -0
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +4 -2
- data/lib/rubocop/cop/metrics/line_length.rb +35 -13
- data/lib/rubocop/cop/metrics/method_length.rb +2 -1
- data/lib/rubocop/cop/metrics/module_length.rb +1 -0
- data/lib/rubocop/cop/metrics/parameter_lists.rb +2 -1
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +4 -2
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +3 -10
- data/lib/rubocop/cop/mixin/annotation_comment.rb +1 -0
- data/lib/rubocop/cop/mixin/array_hash_indentation.rb +80 -0
- data/lib/rubocop/cop/mixin/array_syntax.rb +2 -1
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +14 -20
- data/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +5 -4
- data/lib/rubocop/cop/mixin/check_assignment.rb +20 -15
- data/lib/rubocop/cop/mixin/classish_length.rb +1 -0
- data/lib/rubocop/cop/mixin/code_length.rb +1 -0
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +17 -15
- data/lib/rubocop/cop/mixin/configurable_max.rb +1 -0
- data/lib/rubocop/cop/mixin/configurable_naming.rb +4 -0
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +9 -4
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +24 -16
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +3 -2
- data/lib/rubocop/cop/mixin/hash_node.rb +15 -0
- data/lib/rubocop/cop/mixin/if_node.rb +1 -0
- data/lib/rubocop/cop/mixin/method_complexity.rb +1 -0
- data/lib/rubocop/cop/mixin/method_preference.rb +1 -0
- data/lib/rubocop/cop/mixin/min_body_length.rb +1 -0
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +177 -0
- data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -0
- data/lib/rubocop/cop/mixin/on_method_def.rb +6 -5
- data/lib/rubocop/cop/mixin/on_normal_if_unless.rb +1 -0
- data/lib/rubocop/cop/mixin/parentheses.rb +22 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -0
- data/lib/rubocop/cop/mixin/percent_literal.rb +1 -0
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +79 -0
- data/lib/rubocop/cop/mixin/safe_assignment.rb +1 -0
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +2 -1
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +2 -1
- data/lib/rubocop/cop/mixin/space_inside.rb +2 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +6 -5
- data/lib/rubocop/cop/mixin/string_help.rb +2 -9
- data/lib/rubocop/cop/mixin/string_literals_help.rb +13 -7
- data/lib/rubocop/cop/mixin/surrounding_space.rb +3 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +134 -0
- data/lib/rubocop/cop/mixin/unused_argument.rb +1 -0
- data/lib/rubocop/cop/offense.rb +19 -14
- data/lib/rubocop/cop/performance/case_when_splat.rb +8 -8
- data/lib/rubocop/cop/performance/casecmp.rb +54 -0
- data/lib/rubocop/cop/performance/count.rb +10 -9
- data/lib/rubocop/cop/performance/detect.rb +6 -5
- data/lib/rubocop/cop/performance/double_start_end_with.rb +65 -0
- data/lib/rubocop/cop/performance/end_with.rb +55 -0
- data/lib/rubocop/cop/performance/fixed_size.rb +1 -0
- data/lib/rubocop/cop/performance/flat_map.rb +9 -8
- data/lib/rubocop/cop/performance/hash_each.rb +86 -0
- data/lib/rubocop/cop/performance/lstrip_rstrip.rb +44 -0
- data/lib/rubocop/cop/performance/range_include.rb +40 -0
- data/lib/rubocop/cop/performance/redundant_block_call.rb +57 -0
- data/lib/rubocop/cop/performance/redundant_match.rb +51 -0
- data/lib/rubocop/cop/performance/redundant_merge.rb +85 -0
- data/lib/rubocop/cop/performance/redundant_sort_by.rb +45 -0
- data/lib/rubocop/cop/performance/reverse_each.rb +3 -2
- data/lib/rubocop/cop/performance/sample.rb +6 -5
- data/lib/rubocop/cop/performance/size.rb +2 -1
- data/lib/rubocop/cop/performance/start_with.rb +58 -0
- data/lib/rubocop/cop/performance/string_replacement.rb +18 -23
- data/lib/rubocop/cop/performance/times_map.rb +49 -0
- data/lib/rubocop/cop/rails/action_filter.rb +4 -3
- data/lib/rubocop/cop/rails/date.rb +5 -4
- data/lib/rubocop/cop/rails/delegate.rb +3 -2
- data/lib/rubocop/cop/rails/find_by.rb +20 -14
- data/lib/rubocop/cop/rails/find_each.rb +23 -2
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +3 -2
- data/lib/rubocop/cop/rails/output.rb +4 -2
- data/lib/rubocop/cop/rails/pluralization_grammar.rb +3 -2
- data/lib/rubocop/cop/rails/read_write_attribute.rb +5 -7
- data/lib/rubocop/cop/rails/scope_args.rb +3 -2
- data/lib/rubocop/cop/rails/time_zone.rb +14 -10
- data/lib/rubocop/cop/rails/validation.rb +4 -3
- data/lib/rubocop/cop/severity.rb +8 -7
- data/lib/rubocop/cop/style/access_modifier_indentation.rb +5 -4
- data/lib/rubocop/cop/style/accessor_method_name.rb +1 -0
- data/lib/rubocop/cop/style/alias.rb +84 -24
- data/lib/rubocop/cop/style/align_array.rb +2 -1
- data/lib/rubocop/cop/style/align_hash.rb +13 -14
- data/lib/rubocop/cop/style/align_parameters.rb +3 -2
- data/lib/rubocop/cop/style/and_or.rb +9 -7
- data/lib/rubocop/cop/style/array_join.rb +5 -5
- data/lib/rubocop/cop/style/ascii_comments.rb +2 -1
- data/lib/rubocop/cop/style/ascii_identifiers.rb +2 -1
- data/lib/rubocop/cop/style/attr.rb +30 -5
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +3 -3
- data/lib/rubocop/cop/style/bare_percent_literals.rb +2 -1
- data/lib/rubocop/cop/style/begin_block.rb +2 -1
- data/lib/rubocop/cop/style/block_comments.rb +2 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +10 -9
- data/lib/rubocop/cop/style/block_end_newline.rb +3 -2
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +9 -8
- data/lib/rubocop/cop/style/case_equality.rb +2 -1
- data/lib/rubocop/cop/style/case_indentation.rb +2 -1
- data/lib/rubocop/cop/style/character_literal.rb +11 -7
- data/lib/rubocop/cop/style/class_and_module_camel_case.rb +2 -1
- data/lib/rubocop/cop/style/class_and_module_children.rb +3 -2
- data/lib/rubocop/cop/style/class_check.rb +2 -1
- data/lib/rubocop/cop/style/class_methods.rb +2 -1
- data/lib/rubocop/cop/style/class_vars.rb +2 -1
- data/lib/rubocop/cop/style/closing_parenthesis_indentation.rb +3 -2
- data/lib/rubocop/cop/style/collection_methods.rb +2 -1
- data/lib/rubocop/cop/style/colon_method_call.rb +3 -2
- data/lib/rubocop/cop/style/command_literal.rb +8 -7
- data/lib/rubocop/cop/style/comment_annotation.rb +3 -2
- data/lib/rubocop/cop/style/comment_indentation.rb +4 -6
- data/lib/rubocop/cop/style/conditional_assignment.rb +362 -0
- data/lib/rubocop/cop/style/constant_name.rb +2 -1
- data/lib/rubocop/cop/style/copyright.rb +7 -6
- data/lib/rubocop/cop/style/def_with_parentheses.rb +2 -1
- data/lib/rubocop/cop/style/deprecated_hash_methods.rb +3 -2
- data/lib/rubocop/cop/style/documentation.rb +7 -11
- data/lib/rubocop/cop/style/dot_position.rb +3 -2
- data/lib/rubocop/cop/style/double_negation.rb +2 -1
- data/lib/rubocop/cop/style/each_with_object.rb +4 -3
- data/lib/rubocop/cop/style/else_alignment.rb +3 -2
- data/lib/rubocop/cop/style/empty_else.rb +4 -3
- data/lib/rubocop/cop/style/empty_line_between_defs.rb +2 -1
- data/lib/rubocop/cop/style/empty_lines.rb +10 -4
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +13 -5
- data/lib/rubocop/cop/style/empty_lines_around_block_body.rb +7 -3
- data/lib/rubocop/cop/style/empty_lines_around_class_body.rb +6 -3
- data/lib/rubocop/cop/style/empty_lines_around_method_body.rb +4 -3
- data/lib/rubocop/cop/style/empty_lines_around_module_body.rb +4 -2
- data/lib/rubocop/cop/style/empty_literal.rb +20 -5
- data/lib/rubocop/cop/style/encoding.rb +8 -11
- data/lib/rubocop/cop/style/end_block.rb +3 -1
- data/lib/rubocop/cop/style/end_of_line.rb +2 -1
- data/lib/rubocop/cop/style/even_odd.rb +4 -3
- data/lib/rubocop/cop/style/extra_spacing.rb +110 -74
- data/lib/rubocop/cop/style/file_name.rb +103 -6
- data/lib/rubocop/cop/style/first_array_element_line_break.rb +3 -2
- data/lib/rubocop/cop/style/first_hash_element_line_break.rb +5 -6
- data/lib/rubocop/cop/style/first_method_argument_line_break.rb +14 -1
- data/lib/rubocop/cop/style/first_method_parameter_line_break.rb +2 -1
- data/lib/rubocop/cop/style/first_parameter_indentation.rb +6 -4
- data/lib/rubocop/cop/style/flip_flop.rb +2 -1
- data/lib/rubocop/cop/style/for.rb +2 -1
- data/lib/rubocop/cop/style/format_string.rb +1 -0
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +89 -0
- data/lib/rubocop/cop/style/global_vars.rb +2 -1
- data/lib/rubocop/cop/style/guard_clause.rb +63 -11
- data/lib/rubocop/cop/style/hash_syntax.rb +10 -10
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +93 -0
- data/lib/rubocop/cop/style/if_inside_else.rb +49 -0
- data/lib/rubocop/cop/style/if_unless_modifier.rb +6 -5
- data/lib/rubocop/cop/style/if_with_semicolon.rb +2 -1
- data/lib/rubocop/cop/style/indent_array.rb +89 -38
- data/lib/rubocop/cop/style/indent_assignment.rb +43 -0
- data/lib/rubocop/cop/style/indent_hash.rb +16 -77
- data/lib/rubocop/cop/style/indentation_consistency.rb +2 -1
- data/lib/rubocop/cop/style/indentation_width.rb +11 -11
- data/lib/rubocop/cop/style/infinite_loop.rb +5 -9
- data/lib/rubocop/cop/style/initial_indentation.rb +2 -1
- data/lib/rubocop/cop/style/inline_comment.rb +2 -1
- data/lib/rubocop/cop/style/lambda.rb +14 -11
- data/lib/rubocop/cop/style/lambda_call.rb +4 -4
- data/lib/rubocop/cop/style/leading_comment_space.rb +2 -1
- data/lib/rubocop/cop/style/line_end_concatenation.rb +3 -1
- data/lib/rubocop/cop/style/method_call_parentheses.rb +9 -1
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +3 -2
- data/lib/rubocop/cop/style/method_def_parentheses.rb +4 -4
- data/lib/rubocop/cop/style/method_name.rb +1 -0
- data/lib/rubocop/cop/style/missing_else.rb +5 -3
- data/lib/rubocop/cop/style/module_function.rb +2 -1
- data/lib/rubocop/cop/style/multiline_array_brace_layout.rb +95 -0
- data/lib/rubocop/cop/style/multiline_assignment_layout.rb +91 -0
- data/lib/rubocop/cop/style/multiline_block_chain.rb +3 -2
- data/lib/rubocop/cop/style/multiline_block_layout.rb +11 -9
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -0
- data/lib/rubocop/cop/style/multiline_method_call_indentation.rb +137 -0
- data/lib/rubocop/cop/style/multiline_operation_indentation.rb +25 -135
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +2 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +4 -5
- data/lib/rubocop/cop/style/negated_if.rb +3 -3
- data/lib/rubocop/cop/style/negated_while.rb +3 -3
- data/lib/rubocop/cop/style/nested_modifier.rb +6 -5
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +48 -0
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +2 -1
- data/lib/rubocop/cop/style/next.rb +79 -15
- data/lib/rubocop/cop/style/nil_comparison.rb +5 -5
- data/lib/rubocop/cop/style/non_nil_check.rb +5 -5
- data/lib/rubocop/cop/style/not.rb +5 -9
- data/lib/rubocop/cop/style/numeric_literals.rb +5 -4
- data/lib/rubocop/cop/style/one_line_conditional.rb +3 -2
- data/lib/rubocop/cop/style/op_method.rb +7 -4
- data/lib/rubocop/cop/style/option_hash.rb +13 -7
- data/lib/rubocop/cop/style/optional_arguments.rb +3 -2
- data/lib/rubocop/cop/style/parallel_assignment.rb +40 -16
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +3 -16
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +3 -2
- data/lib/rubocop/cop/style/percent_q_literals.rb +3 -6
- data/lib/rubocop/cop/style/perl_backrefs.rb +4 -3
- data/lib/rubocop/cop/style/predicate_name.rb +1 -0
- data/lib/rubocop/cop/style/proc.rb +3 -2
- data/lib/rubocop/cop/style/raise_args.rb +2 -1
- data/lib/rubocop/cop/style/redundant_begin.rb +2 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +5 -5
- data/lib/rubocop/cop/style/redundant_freeze.rb +5 -4
- data/lib/rubocop/cop/style/redundant_parentheses.rb +80 -0
- data/lib/rubocop/cop/style/redundant_return.rb +5 -4
- data/lib/rubocop/cop/style/redundant_self.rb +7 -8
- data/lib/rubocop/cop/style/regexp_literal.rb +9 -8
- data/lib/rubocop/cop/style/rescue_ensure_alignment.rb +3 -2
- data/lib/rubocop/cop/style/rescue_modifier.rb +11 -9
- data/lib/rubocop/cop/style/self_assignment.rb +4 -5
- data/lib/rubocop/cop/style/semicolon.rb +3 -2
- data/lib/rubocop/cop/style/send.rb +3 -1
- data/lib/rubocop/cop/style/signal_exception.rb +5 -3
- data/lib/rubocop/cop/style/single_line_block_params.rb +2 -1
- data/lib/rubocop/cop/style/single_line_methods.rb +7 -7
- data/lib/rubocop/cop/style/space_after_colon.rb +2 -1
- data/lib/rubocop/cop/style/space_after_comma.rb +1 -0
- data/lib/rubocop/cop/style/space_after_control_keyword.rb +5 -5
- data/lib/rubocop/cop/style/space_after_method_name.rb +3 -2
- data/lib/rubocop/cop/style/space_after_not.rb +4 -3
- data/lib/rubocop/cop/style/space_after_semicolon.rb +1 -0
- data/lib/rubocop/cop/style/space_around_block_parameters.rb +8 -7
- data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +1 -0
- data/lib/rubocop/cop/style/space_around_operators.rb +72 -32
- data/lib/rubocop/cop/style/space_before_block_braces.rb +2 -1
- data/lib/rubocop/cop/style/space_before_comma.rb +1 -0
- data/lib/rubocop/cop/style/space_before_comment.rb +2 -1
- data/lib/rubocop/cop/style/{single_space_before_first_arg.rb → space_before_first_arg.rb} +13 -4
- data/lib/rubocop/cop/style/space_before_modifier_keyword.rb +4 -3
- data/lib/rubocop/cop/style/space_before_semicolon.rb +1 -0
- data/lib/rubocop/cop/style/space_inside_block_braces.rb +3 -2
- data/lib/rubocop/cop/style/space_inside_brackets.rb +1 -0
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +4 -1
- data/lib/rubocop/cop/style/space_inside_parens.rb +1 -0
- data/lib/rubocop/cop/style/space_inside_range_literal.rb +5 -4
- data/lib/rubocop/cop/style/space_inside_string_interpolation.rb +8 -17
- data/lib/rubocop/cop/style/special_global_vars.rb +97 -52
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +16 -9
- data/lib/rubocop/cop/style/string_literals.rb +41 -1
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +2 -1
- data/lib/rubocop/cop/style/string_methods.rb +2 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -2
- data/lib/rubocop/cop/style/symbol_array.rb +74 -7
- data/lib/rubocop/cop/style/symbol_literal.rb +4 -7
- data/lib/rubocop/cop/style/symbol_proc.rb +11 -7
- data/lib/rubocop/cop/style/tab.rb +25 -2
- data/lib/rubocop/cop/style/trailing_blank_lines.rb +1 -2
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +45 -0
- data/lib/rubocop/cop/style/trailing_comma_in_literal.rb +56 -0
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +8 -7
- data/lib/rubocop/cop/style/trailing_whitespace.rb +2 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +18 -9
- data/lib/rubocop/cop/style/unless_else.rb +2 -1
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +4 -3
- data/lib/rubocop/cop/style/unneeded_interpolation.rb +87 -0
- data/lib/rubocop/cop/style/unneeded_percent_q.rb +23 -7
- data/lib/rubocop/cop/style/variable_interpolation.rb +8 -6
- data/lib/rubocop/cop/style/variable_name.rb +1 -0
- data/lib/rubocop/cop/style/when_then.rb +2 -1
- data/lib/rubocop/cop/style/while_until_do.rb +3 -2
- data/lib/rubocop/cop/style/while_until_modifier.rb +3 -4
- data/lib/rubocop/cop/style/word_array.rb +74 -51
- data/lib/rubocop/cop/team.rb +21 -15
- data/lib/rubocop/cop/util.rb +102 -69
- data/lib/rubocop/cop/variable_force.rb +2 -1
- data/lib/rubocop/cop/variable_force/assignment.rb +2 -1
- data/lib/rubocop/cop/variable_force/locatable.rb +1 -0
- data/lib/rubocop/cop/variable_force/reference.rb +1 -0
- data/lib/rubocop/cop/variable_force/scope.rb +2 -1
- data/lib/rubocop/cop/variable_force/variable.rb +2 -1
- data/lib/rubocop/cop/variable_force/variable_table.rb +2 -1
- data/lib/rubocop/error.rb +12 -0
- data/lib/rubocop/formatter/base_formatter.rb +10 -1
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -0
- data/lib/rubocop/formatter/colorizable.rb +6 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +29 -15
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +3 -1
- data/lib/rubocop/formatter/emacs_style_formatter.rb +7 -3
- data/lib/rubocop/formatter/file_list_formatter.rb +1 -0
- data/lib/rubocop/formatter/formatter_set.rb +10 -19
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +2 -1
- data/lib/rubocop/formatter/html_formatter.rb +15 -14
- data/lib/rubocop/formatter/json_formatter.rb +2 -1
- data/lib/rubocop/formatter/offense_count_formatter.rb +1 -0
- data/lib/rubocop/formatter/progress_formatter.rb +3 -3
- data/lib/rubocop/formatter/simple_text_formatter.rb +50 -17
- data/lib/rubocop/formatter/text_util.rb +8 -10
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +61 -0
- data/lib/rubocop/name_similarity.rb +22 -0
- data/lib/rubocop/node_pattern.rb +126 -35
- data/lib/rubocop/options.rb +28 -19
- data/lib/rubocop/path_util.rb +1 -0
- data/lib/rubocop/processed_source.rb +41 -16
- data/lib/rubocop/rake_task.rb +6 -9
- data/lib/rubocop/remote_config.rb +1 -0
- data/lib/rubocop/result_cache.rb +60 -43
- data/lib/rubocop/runner.rb +48 -45
- data/lib/rubocop/string_util.rb +1 -0
- data/lib/rubocop/target_finder.rb +2 -1
- data/lib/rubocop/token.rb +1 -0
- data/lib/rubocop/version.rb +3 -2
- data/lib/rubocop/warning.rb +1 -0
- data/relnotes/v0.36.0.md +306 -0
- data/rubocop.gemspec +3 -9
- metadata +48 -92
- data/lib/rubocop/cop/lint/space_before_first_arg.rb +0 -44
- data/lib/rubocop/cop/rails/default_scope.rb +0 -33
- data/lib/rubocop/cop/style/trailing_comma.rb +0 -182
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
@@ -6,7 +7,7 @@ module RuboCop
|
|
6
7
|
# This cop looks for *unless* expressions with *else* clauses.
|
7
8
|
class UnlessElse < Cop
|
8
9
|
MSG = 'Do not use `unless` with `else`. Rewrite these with the ' \
|
9
|
-
'positive case first.'
|
10
|
+
'positive case first.'.freeze
|
10
11
|
|
11
12
|
def on_if(node)
|
12
13
|
loc = node.loc
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
@@ -7,8 +8,8 @@ module RuboCop
|
|
7
8
|
class UnneededCapitalW < Cop
|
8
9
|
include PercentLiteral
|
9
10
|
|
10
|
-
MSG =
|
11
|
-
|
11
|
+
MSG = 'Do not use `%W` unless interpolation is needed. ' \
|
12
|
+
'If not, use `%w`.'.freeze
|
12
13
|
|
13
14
|
def on_array(node)
|
14
15
|
process(node, '%W')
|
@@ -19,7 +20,7 @@ module RuboCop
|
|
19
20
|
def on_percent_literal(node)
|
20
21
|
requires_interpolation = node.children.any? do |string|
|
21
22
|
string.type == :dstr ||
|
22
|
-
|
23
|
+
double_quotes_acceptable?(string.str_content)
|
23
24
|
end
|
24
25
|
add_offense(node, :expression) unless requires_interpolation
|
25
26
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module RuboCop
|
5
|
+
module Cop
|
6
|
+
module Style
|
7
|
+
# This cop checks for strings that are just an interpolated expression.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
#
|
11
|
+
# # bad
|
12
|
+
# "#{@var}"
|
13
|
+
#
|
14
|
+
# # good
|
15
|
+
# @var.to_s
|
16
|
+
#
|
17
|
+
# # good if @var is already a String
|
18
|
+
# @var
|
19
|
+
class UnneededInterpolation < Cop
|
20
|
+
include PercentLiteral
|
21
|
+
|
22
|
+
MSG = 'Prefer `to_s` over string interpolation.'.freeze
|
23
|
+
|
24
|
+
def on_dstr(node)
|
25
|
+
add_offense(node, :expression, MSG) if single_interpolation?(node)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def single_interpolation?(node)
|
31
|
+
single_child?(node) &&
|
32
|
+
interpolation?(node.children.first) &&
|
33
|
+
!implicit_concatenation?(node) &&
|
34
|
+
!embedded_in_percent_array?(node)
|
35
|
+
end
|
36
|
+
|
37
|
+
def single_variable_interpolation?(node)
|
38
|
+
single_child?(node) && variable_interpolation?(node.children.first)
|
39
|
+
end
|
40
|
+
|
41
|
+
def single_child?(node)
|
42
|
+
node.children.size == 1
|
43
|
+
end
|
44
|
+
|
45
|
+
def interpolation?(node)
|
46
|
+
variable_interpolation?(node) || node.type == :begin
|
47
|
+
end
|
48
|
+
|
49
|
+
def variable_interpolation?(node)
|
50
|
+
node.variable? || node.reference?
|
51
|
+
end
|
52
|
+
|
53
|
+
def implicit_concatenation?(node)
|
54
|
+
node.parent && node.parent.type == :dstr
|
55
|
+
end
|
56
|
+
|
57
|
+
def embedded_in_percent_array?(node)
|
58
|
+
node.parent &&
|
59
|
+
node.parent.type == :array &&
|
60
|
+
percent_literal?(node.parent)
|
61
|
+
end
|
62
|
+
|
63
|
+
def autocorrect(node)
|
64
|
+
loc = node.loc
|
65
|
+
embedded_node = node.children.first
|
66
|
+
embedded_loc = embedded_node.loc
|
67
|
+
|
68
|
+
if variable_interpolation?(embedded_node)
|
69
|
+
replacement = "#{embedded_loc.expression.source}.to_s"
|
70
|
+
->(corrector) { corrector.replace(loc.expression, replacement) }
|
71
|
+
elsif single_variable_interpolation?(embedded_node)
|
72
|
+
variable_loc = embedded_node.children.first.loc
|
73
|
+
replacement = "#{variable_loc.expression.source}.to_s"
|
74
|
+
->(corrector) { corrector.replace(loc.expression, replacement) }
|
75
|
+
else
|
76
|
+
lambda do |corrector|
|
77
|
+
corrector.replace(loc.begin, '')
|
78
|
+
corrector.replace(loc.end, '')
|
79
|
+
corrector.replace(embedded_loc.begin, '(')
|
80
|
+
corrector.replace(embedded_loc.end, ').to_s')
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
@@ -6,8 +7,9 @@ module RuboCop
|
|
6
7
|
# This cop checks for usage of the %q/%Q syntax when '' or "" would do.
|
7
8
|
class UnneededPercentQ < Cop
|
8
9
|
MSG = 'Use `%s` only for strings that contain both single quotes and ' \
|
9
|
-
'double quotes%s.'
|
10
|
-
DYNAMIC_MSG = ', or for dynamic strings that contain
|
10
|
+
'double quotes%s.'.freeze
|
11
|
+
DYNAMIC_MSG = ', or for dynamic strings that contain ' \
|
12
|
+
'double quotes'.freeze
|
11
13
|
SINGLE_QUOTE = "'".freeze
|
12
14
|
QUOTE = '"'.freeze
|
13
15
|
EMPTY = ''.freeze
|
@@ -30,25 +32,32 @@ module RuboCop
|
|
30
32
|
private
|
31
33
|
|
32
34
|
def check(node)
|
33
|
-
src = node.
|
35
|
+
src = node.source
|
34
36
|
return unless start_with_percent_q_variant?(src)
|
35
37
|
return if src.include?(SINGLE_QUOTE) && src.include?(QUOTE)
|
36
|
-
return if src =~ StringHelp::ESCAPED_CHAR_REGEXP
|
37
38
|
if src.start_with?(PERCENT_Q) && src =~ STRING_INTERPOLATION_REGEXP
|
38
39
|
return
|
39
40
|
end
|
41
|
+
if src.start_with?(PERCENT_CAPITAL_Q) && acceptable_capital_q?(node)
|
42
|
+
return
|
43
|
+
end
|
44
|
+
|
45
|
+
add_offense(node, :expression)
|
46
|
+
end
|
40
47
|
|
48
|
+
def message(node)
|
49
|
+
src = node.source
|
41
50
|
extra = if src.start_with?(PERCENT_CAPITAL_Q)
|
42
51
|
DYNAMIC_MSG
|
43
52
|
else
|
44
53
|
EMPTY
|
45
54
|
end
|
46
|
-
|
55
|
+
format(MSG, src[0, 2], extra)
|
47
56
|
end
|
48
57
|
|
49
58
|
def autocorrect(node)
|
50
59
|
delimiter =
|
51
|
-
node.
|
60
|
+
node.source =~ /^%Q[^"]+$|'/ ? QUOTE : SINGLE_QUOTE
|
52
61
|
lambda do |corrector|
|
53
62
|
corrector.replace(node.loc.begin, delimiter)
|
54
63
|
corrector.replace(node.loc.end, delimiter)
|
@@ -61,7 +70,14 @@ module RuboCop
|
|
61
70
|
end
|
62
71
|
|
63
72
|
def start_with_percent_q_variant?(string)
|
64
|
-
string.start_with?(PERCENT_Q
|
73
|
+
string.start_with?(PERCENT_Q, PERCENT_CAPITAL_Q)
|
74
|
+
end
|
75
|
+
|
76
|
+
def acceptable_capital_q?(node)
|
77
|
+
src = node.source
|
78
|
+
src.include?(QUOTE) &&
|
79
|
+
(src =~ STRING_INTERPOLATION_REGEXP ||
|
80
|
+
(node.str_type? && double_quotes_acceptable?(node.str_content)))
|
65
81
|
end
|
66
82
|
end
|
67
83
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
5
6
|
module Style
|
6
7
|
# This cop checks for variable interpolation (like "#@ivar").
|
7
8
|
class VariableInterpolation < Cop
|
8
|
-
MSG = 'Replace interpolated variable `%s`
|
9
|
+
MSG = 'Replace interpolated variable `%s` ' \
|
10
|
+
'with expression `#{%s}`.'.freeze
|
9
11
|
|
10
12
|
def on_dstr(node)
|
11
13
|
check_for_interpolation(node)
|
@@ -23,19 +25,19 @@ module RuboCop
|
|
23
25
|
|
24
26
|
def check_for_interpolation(node)
|
25
27
|
var_nodes(node.children).each do |v|
|
26
|
-
var = v.
|
27
|
-
|
28
|
+
var = v.source
|
28
29
|
add_offense(v, :expression, format(MSG, var, var))
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
33
|
def autocorrect(node)
|
33
|
-
|
34
|
-
|
34
|
+
lambda do |corrector|
|
35
|
+
corrector.replace(node.source_range, "{#{node.source}}")
|
36
|
+
end
|
35
37
|
end
|
36
38
|
|
37
39
|
def var_nodes(nodes)
|
38
|
-
nodes.select { |n|
|
40
|
+
nodes.select { |n| n.variable? || n.reference? }
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
5
6
|
module Style
|
6
7
|
# This cop checks for *when;* uses in *case* expressions.
|
7
8
|
class WhenThen < Cop
|
8
|
-
MSG = 'Do not use `when x;`. Use `when x then` instead.'
|
9
|
+
MSG = 'Do not use `when x;`. Use `when x then` instead.'.freeze
|
9
10
|
|
10
11
|
def on_when(node)
|
11
12
|
return unless node.loc.begin && node.loc.begin.is?(';')
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
@@ -14,7 +15,7 @@ module RuboCop
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def handle(node)
|
17
|
-
length = node.
|
18
|
+
length = node.source.lines.to_a.size
|
18
19
|
return unless length > 1
|
19
20
|
return unless node.loc.begin && node.loc.begin.is?('do')
|
20
21
|
|
@@ -29,7 +30,7 @@ module RuboCop
|
|
29
30
|
|
30
31
|
def autocorrect(node)
|
31
32
|
condition_node, = *node
|
32
|
-
end_of_condition_range = condition_node.
|
33
|
+
end_of_condition_range = condition_node.source_range.end
|
33
34
|
do_range = node.loc.begin
|
34
35
|
whitespaces_and_do_range = end_of_condition_range.join(do_range)
|
35
36
|
->(corrector) { corrector.remove(whitespaces_and_do_range) }
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
@@ -19,10 +20,8 @@ module RuboCop
|
|
19
20
|
|
20
21
|
def autocorrect(node)
|
21
22
|
cond, body = *node
|
22
|
-
oneline = "#{body.loc.
|
23
|
-
|
24
|
-
cond.loc.expression.source
|
25
|
-
->(corrector) { corrector.replace(node.loc.expression, oneline) }
|
23
|
+
oneline = "#{body.source} #{node.loc.keyword.source} " + cond.source
|
24
|
+
->(corrector) { corrector.replace(node.source_range, oneline) }
|
26
25
|
end
|
27
26
|
|
28
27
|
private
|
@@ -1,55 +1,75 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module RuboCop
|
4
5
|
module Cop
|
5
6
|
module Style
|
6
|
-
# This cop
|
7
|
+
# This cop can check for array literals made up of word-like
|
7
8
|
# strings, that are not using the %w() syntax.
|
9
|
+
#
|
10
|
+
# Alternatively, it can check for uses of the %w() syntax, in projects
|
11
|
+
# which do not want to include that syntax.
|
8
12
|
class WordArray < Cop
|
9
13
|
include ArraySyntax
|
10
|
-
# The parameter is called MinSize (meaning the minimum array size for
|
11
|
-
# which an offense can be registered), but essentially it's a Max
|
12
|
-
# parameter (the maximum number of something that's allowed).
|
13
|
-
include ConfigurableMax
|
14
14
|
|
15
|
-
|
15
|
+
PERCENT_MSG = 'Use `%w` or `%W` for an array of words.'.freeze
|
16
|
+
ARRAY_MSG = 'Use `[]` for an array of words.'.freeze
|
16
17
|
QUESTION_MARK_SIZE = '?'.size
|
17
18
|
|
18
19
|
def on_array(node)
|
19
20
|
array_elems = node.children
|
20
|
-
return unless array_of?(:str, node) &&
|
21
|
-
!complex_content?(array_elems) &&
|
22
|
-
array_elems.size > min_size && !comments_in_array?(node)
|
23
21
|
|
24
|
-
|
22
|
+
if bracketed_array_of?(:str, node)
|
23
|
+
return if complex_content?(array_elems) ||
|
24
|
+
comments_in_array?(node)
|
25
|
+
style_detected(:brackets, array_elems.size)
|
26
|
+
|
27
|
+
if style == :percent && array_elems.size >= min_size
|
28
|
+
add_offense(node, :expression, PERCENT_MSG)
|
29
|
+
end
|
30
|
+
elsif node.loc.begin && node.loc.begin.source =~ /\A%[wW]/
|
31
|
+
style_detected(:percent, array_elems.size)
|
32
|
+
add_offense(node, :expression, ARRAY_MSG) if style == :brackets
|
33
|
+
end
|
25
34
|
end
|
26
35
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
36
|
+
def autocorrect(node)
|
37
|
+
words = node.children
|
38
|
+
if style == :percent
|
39
|
+
escape = words.any? { |w| double_quotes_required?(w.children[0]) }
|
40
|
+
char = escape ? 'W' : 'w'
|
41
|
+
contents = autocorrect_words(words, escape, node.loc.line)
|
42
|
+
lambda do |corrector|
|
43
|
+
corrector.replace(node.source_range, "%#{char}(#{contents})")
|
44
|
+
end
|
45
|
+
else
|
46
|
+
words = words.map { |w| to_string_literal(w.children[0]) }
|
47
|
+
lambda do |corrector|
|
48
|
+
corrector.replace(node.source_range, "[#{words.join(', ')}]")
|
49
|
+
end
|
50
|
+
end
|
31
51
|
end
|
32
52
|
|
53
|
+
private
|
54
|
+
|
33
55
|
def comments_in_array?(node)
|
34
56
|
comments = processed_source.comments
|
35
|
-
|
36
|
-
array_range = node.loc.expression.to_a
|
57
|
+
array_range = node.source_range.to_a
|
37
58
|
|
38
59
|
comments.any? do |comment|
|
39
60
|
!(comment.loc.expression.to_a & array_range).empty?
|
40
61
|
end
|
41
62
|
end
|
42
63
|
|
43
|
-
def complex_content?(
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
str_content = Util.strip_quotes(source)
|
49
|
-
return true unless str_content =~ word_regex
|
64
|
+
def complex_content?(strings)
|
65
|
+
strings.any? do |s|
|
66
|
+
string = s.str_content
|
67
|
+
string !~ word_regex || string =~ / /
|
50
68
|
end
|
69
|
+
end
|
51
70
|
|
52
|
-
|
71
|
+
def style
|
72
|
+
cop_config['EnforcedStyle'].to_sym
|
53
73
|
end
|
54
74
|
|
55
75
|
def min_size
|
@@ -60,43 +80,46 @@ module RuboCop
|
|
60
80
|
cop_config['WordRegex']
|
61
81
|
end
|
62
82
|
|
63
|
-
def
|
64
|
-
@interpolated = false
|
65
|
-
contents = autocorrect_words(node.children, node.loc.line)
|
66
|
-
|
67
|
-
char = @interpolated ? 'W' : 'w'
|
68
|
-
|
69
|
-
lambda do |corrector|
|
70
|
-
corrector.replace(node.loc.expression, "%#{char}(#{contents})")
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def autocorrect_words(word_nodes, base_line_number)
|
83
|
+
def autocorrect_words(word_nodes, escape, base_line_number)
|
75
84
|
previous_node_line_number = base_line_number
|
76
85
|
word_nodes.map do |node|
|
77
86
|
number_of_line_breaks = node.loc.line - previous_node_line_number
|
78
87
|
line_breaks = "\n" * number_of_line_breaks
|
79
88
|
previous_node_line_number = node.loc.line
|
80
|
-
|
81
|
-
|
89
|
+
content = node.children[0]
|
90
|
+
content = escape ? escape_string(content) : content
|
91
|
+
content.gsub!(/\)/, '\\)')
|
92
|
+
line_breaks + content
|
82
93
|
end.join(' ')
|
83
94
|
end
|
84
95
|
|
85
|
-
def
|
86
|
-
|
87
|
-
@interpolated = true
|
88
|
-
begin_pos = str_node.loc.expression.begin_pos + QUESTION_MARK_SIZE
|
89
|
-
end_pos = str_node.loc.expression.end_pos
|
90
|
-
else
|
91
|
-
begin_pos = str_node.loc.begin.end_pos
|
92
|
-
end_pos = str_node.loc.end.begin_pos
|
93
|
-
end
|
94
|
-
Parser::Source::Range.new(str_node.loc.expression.source_buffer,
|
95
|
-
begin_pos, end_pos).source
|
96
|
+
def escape_string(string)
|
97
|
+
string.inspect[1..-2].tap { |s| s.gsub!(/\\"/, '"') }
|
96
98
|
end
|
97
99
|
|
98
|
-
def
|
99
|
-
|
100
|
+
def style_detected(style, ary_size)
|
101
|
+
cfg = config_to_allow_offenses
|
102
|
+
return if cfg['Enabled'] == false
|
103
|
+
|
104
|
+
@largest_brackets ||= -Float::INFINITY
|
105
|
+
@smallest_percent ||= Float::INFINITY
|
106
|
+
|
107
|
+
if style == :percent
|
108
|
+
@smallest_percent = ary_size if ary_size < @smallest_percent
|
109
|
+
elsif ary_size > @largest_brackets
|
110
|
+
@largest_brackets = ary_size
|
111
|
+
end
|
112
|
+
|
113
|
+
if cfg['EnforcedStyle'] == style.to_s
|
114
|
+
# do nothing
|
115
|
+
elsif cfg['EnforcedStyle'].nil?
|
116
|
+
cfg['EnforcedStyle'] = style.to_s
|
117
|
+
elsif @smallest_percent <= @largest_brackets
|
118
|
+
self.config_to_allow_offenses = { 'Enabled' => false }
|
119
|
+
else
|
120
|
+
cfg['EnforcedStyle'] = 'percent'
|
121
|
+
cfg['MinSize'] = @largest_brackets + 1
|
122
|
+
end
|
100
123
|
end
|
101
124
|
end
|
102
125
|
end
|