rubocop 0.49.1 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -9
- data/bin/rubocop +1 -1
- data/config/default.yml +264 -118
- data/config/disabled.yml +13 -9
- data/config/enabled.yml +1156 -918
- data/lib/rubocop.rb +555 -489
- data/lib/rubocop/ast/builder.rb +6 -1
- data/lib/rubocop/ast/node.rb +68 -52
- data/lib/rubocop/ast/node/args_node.rb +15 -10
- data/lib/rubocop/ast/node/array_node.rb +10 -1
- data/lib/rubocop/ast/node/block_node.rb +9 -0
- data/lib/rubocop/ast/node/def_node.rb +71 -0
- data/lib/rubocop/ast/node/for_node.rb +8 -0
- data/lib/rubocop/ast/node/if_node.rb +10 -2
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +16 -0
- data/lib/rubocop/ast/node/mixin/collection_node.rb +15 -0
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +174 -0
- data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +89 -0
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +18 -31
- data/lib/rubocop/ast/node/regexp_node.rb +35 -0
- data/lib/rubocop/ast/node/send_node.rb +21 -150
- data/lib/rubocop/ast/node/str_node.rb +14 -0
- data/lib/rubocop/ast/node/super_node.rb +3 -24
- data/lib/rubocop/ast/node/symbol_node.rb +20 -0
- data/lib/rubocop/ast/node/yield_node.rb +21 -0
- data/lib/rubocop/ast/traversal.rb +7 -7
- data/lib/rubocop/cached_data.rb +1 -6
- data/lib/rubocop/cli.rb +59 -13
- data/lib/rubocop/comment_config.rb +2 -5
- data/lib/rubocop/config.rb +136 -29
- data/lib/rubocop/config_loader.rb +61 -104
- data/lib/rubocop/config_loader_resolver.rb +102 -4
- data/lib/rubocop/cop/autocorrect_logic.rb +1 -1
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +13 -11
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +67 -0
- data/lib/rubocop/cop/bundler/ordered_gems.rb +7 -58
- data/lib/rubocop/cop/commissioner.rb +6 -3
- data/lib/rubocop/cop/cop.rb +11 -6
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +102 -0
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +97 -0
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +87 -0
- data/lib/rubocop/cop/generator.rb +122 -25
- data/lib/rubocop/cop/internal_affairs.rb +6 -2
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +16 -5
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +54 -0
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +59 -0
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +71 -0
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +3 -3
- data/lib/rubocop/cop/layout/access_modifier_indentation.rb +6 -10
- data/lib/rubocop/cop/layout/align_array.rb +2 -2
- data/lib/rubocop/cop/layout/align_hash.rb +18 -18
- data/lib/rubocop/cop/layout/align_parameters.rb +11 -23
- data/lib/rubocop/cop/layout/block_end_newline.rb +20 -6
- data/lib/rubocop/cop/layout/case_indentation.rb +15 -18
- data/lib/rubocop/cop/layout/class_structure.rb +306 -0
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +7 -6
- data/lib/rubocop/cop/layout/comment_indentation.rb +42 -3
- data/lib/rubocop/cop/layout/dot_position.rb +31 -13
- data/lib/rubocop/cop/layout/else_alignment.rb +37 -17
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +22 -18
- data/lib/rubocop/cop/layout/empty_lines.rb +16 -2
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +23 -6
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +89 -0
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +2 -2
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +4 -8
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +30 -5
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +10 -6
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +5 -5
- data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +22 -7
- data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
- data/lib/rubocop/cop/layout/extra_spacing.rb +23 -26
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +3 -3
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +9 -3
- data/lib/rubocop/cop/layout/indent_array.rb +68 -21
- data/lib/rubocop/cop/layout/indent_hash.rb +71 -26
- data/lib/rubocop/cop/layout/indent_heredoc.rb +70 -35
- data/lib/rubocop/cop/layout/indentation_consistency.rb +1 -2
- data/lib/rubocop/cop/layout/indentation_width.rb +40 -27
- data/lib/rubocop/cop/layout/initial_indentation.rb +10 -7
- data/lib/rubocop/cop/layout/leading_comment_space.rb +32 -17
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +47 -14
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +12 -11
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +19 -16
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +46 -13
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +29 -27
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +7 -3
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +6 -0
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +12 -4
- data/lib/rubocop/cop/layout/space_after_colon.rb +13 -6
- data/lib/rubocop/cop/layout/space_after_comma.rb +11 -1
- data/lib/rubocop/cop/layout/space_after_method_name.rb +8 -6
- data/lib/rubocop/cop/layout/space_after_not.rb +1 -1
- data/lib/rubocop/cop/layout/space_after_semicolon.rb +8 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +32 -25
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +28 -17
- data/lib/rubocop/cop/layout/space_around_keyword.rb +22 -16
- data/lib/rubocop/cop/layout/space_around_operators.rb +27 -14
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +61 -12
- data/lib/rubocop/cop/layout/space_before_comma.rb +12 -1
- data/lib/rubocop/cop/layout/space_before_comment.rb +10 -5
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +5 -4
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +8 -1
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +12 -14
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +235 -0
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +4 -4
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +89 -18
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +62 -36
- data/lib/rubocop/cop/layout/space_inside_parens.rb +40 -3
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +15 -15
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +81 -0
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +32 -17
- data/lib/rubocop/cop/layout/tab.rb +7 -4
- data/lib/rubocop/cop/layout/trailing_blank_lines.rb +11 -9
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +12 -19
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +16 -2
- data/lib/rubocop/cop/lint/block_alignment.rb +42 -30
- data/lib/rubocop/cop/lint/boolean_symbol.rb +38 -0
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +3 -14
- data/lib/rubocop/cop/lint/condition_position.rb +5 -1
- data/lib/rubocop/cop/lint/debugger.rb +18 -11
- data/lib/rubocop/cop/lint/def_end_alignment.rb +9 -14
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +4 -4
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +3 -3
- data/lib/rubocop/cop/lint/duplicate_methods.rb +75 -5
- data/lib/rubocop/cop/lint/duplicated_key.rb +1 -1
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/else_layout.rb +3 -3
- data/lib/rubocop/cop/lint/empty_ensure.rb +1 -1
- data/lib/rubocop/cop/lint/empty_expression.rb +1 -1
- data/lib/rubocop/cop/lint/empty_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/empty_when.rb +1 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +13 -14
- data/lib/rubocop/cop/lint/end_in_method.rb +1 -1
- data/lib/rubocop/cop/lint/ensure_return.rb +1 -1
- data/lib/rubocop/cop/lint/float_out_of_range.rb +5 -5
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +36 -41
- data/lib/rubocop/cop/lint/handle_exceptions.rb +1 -1
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +25 -20
- data/lib/rubocop/cop/lint/inherit_exception.rb +16 -19
- data/lib/rubocop/cop/lint/interpolation_check.rb +37 -0
- data/lib/rubocop/cop/lint/{literal_in_condition.rb → literal_as_condition.rb} +21 -7
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/loop.rb +1 -1
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +81 -0
- data/lib/rubocop/cop/lint/multiple_compare.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +6 -8
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +58 -0
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +1 -1
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +4 -4
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +4 -3
- data/lib/rubocop/cop/lint/percent_string_array.rb +13 -22
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +12 -12
- data/lib/rubocop/cop/lint/rand_one.rb +8 -2
- data/lib/rubocop/cop/lint/redundant_with_index.rb +80 -0
- data/lib/rubocop/cop/lint/redundant_with_object.rb +81 -0
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +29 -0
- data/lib/rubocop/cop/lint/require_parentheses.rb +5 -3
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_type.rb +18 -9
- data/lib/rubocop/cop/lint/return_in_void_context.rb +74 -0
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
- data/lib/rubocop/cop/lint/script_permission.rb +8 -1
- data/lib/rubocop/cop/lint/shadowed_argument.rb +146 -0
- data/lib/rubocop/cop/lint/shadowed_exception.rb +37 -10
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +1 -1
- data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +7 -7
- data/lib/rubocop/cop/lint/syntax.rb +23 -20
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +1 -1
- data/lib/rubocop/cop/lint/unified_integer.rb +5 -4
- data/lib/rubocop/cop/lint/unneeded_disable.rb +41 -16
- data/lib/rubocop/cop/lint/unneeded_require_statement.rb +51 -0
- data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +45 -19
- data/lib/rubocop/cop/lint/unreachable_code.rb +53 -8
- data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -1
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +74 -0
- data/lib/rubocop/cop/lint/uri_regexp.rb +73 -0
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +12 -16
- data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
- data/lib/rubocop/cop/lint/useless_comparison.rb +1 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +15 -12
- data/lib/rubocop/cop/lint/void.rb +38 -27
- data/lib/rubocop/cop/message_annotator.rb +4 -2
- data/lib/rubocop/cop/metrics/abc_size.rb +2 -2
- data/lib/rubocop/cop/metrics/block_nesting.rb +1 -1
- data/lib/rubocop/cop/metrics/class_length.rb +3 -1
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +2 -1
- data/lib/rubocop/cop/metrics/line_length.rb +8 -5
- data/lib/rubocop/cop/metrics/method_length.rb +8 -3
- data/lib/rubocop/cop/metrics/module_length.rb +3 -1
- data/lib/rubocop/cop/metrics/parameter_lists.rb +14 -5
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +2 -1
- data/lib/rubocop/cop/mixin/array_hash_indentation.rb +3 -2
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +2 -2
- data/lib/rubocop/cop/mixin/code_length.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -1
- data/lib/rubocop/cop/mixin/def_node.rb +1 -1
- data/lib/rubocop/cop/mixin/documentation_comment.rb +1 -1
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +14 -7
- data/lib/rubocop/cop/mixin/empty_parameter.rb +23 -0
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +8 -4
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +3 -3
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +12 -3
- data/lib/rubocop/cop/mixin/heredoc.rb +28 -0
- data/lib/rubocop/cop/mixin/method_complexity.rb +33 -7
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +74 -33
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +34 -8
- data/lib/rubocop/cop/mixin/negative_conditional.rb +4 -1
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +67 -0
- data/lib/rubocop/cop/mixin/parentheses.rb +12 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +4 -1
- data/lib/rubocop/cop/mixin/percent_array.rb +52 -0
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +9 -8
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +11 -10
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -17
- data/lib/rubocop/cop/mixin/string_help.rb +1 -1
- data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +95 -8
- data/lib/rubocop/cop/mixin/too_many_lines.rb +2 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +25 -17
- data/lib/rubocop/cop/mixin/unused_argument.rb +6 -2
- data/lib/rubocop/cop/naming/accessor_method_name.rb +55 -0
- data/lib/rubocop/cop/{style → naming}/ascii_identifiers.rb +35 -2
- data/lib/rubocop/cop/{style/op_method.rb → naming/binary_operator_parameter_name.rb} +7 -6
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +33 -0
- data/lib/rubocop/cop/naming/constant_name.rb +58 -0
- data/lib/rubocop/cop/{style → naming}/file_name.rb +28 -13
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +62 -0
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +59 -0
- data/lib/rubocop/cop/naming/method_name.rb +40 -0
- data/lib/rubocop/cop/naming/predicate_name.rb +101 -0
- data/lib/rubocop/cop/naming/variable_name.rb +50 -0
- data/lib/rubocop/cop/{style → naming}/variable_number.rb +11 -28
- data/lib/rubocop/cop/offense.rb +6 -1
- data/lib/rubocop/cop/performance/caller.rb +39 -11
- data/lib/rubocop/cop/performance/case_when_splat.rb +3 -7
- data/lib/rubocop/cop/performance/casecmp.rb +9 -8
- data/lib/rubocop/cop/performance/compare_with_block.rb +23 -13
- data/lib/rubocop/cop/performance/count.rb +7 -4
- data/lib/rubocop/cop/performance/detect.rb +9 -6
- data/lib/rubocop/cop/performance/double_start_end_with.rb +12 -20
- data/lib/rubocop/cop/performance/end_with.rb +6 -6
- data/lib/rubocop/cop/performance/fixed_size.rb +1 -1
- data/lib/rubocop/cop/performance/flat_map.rb +5 -2
- data/lib/rubocop/cop/performance/hash_each_methods.rb +85 -40
- data/lib/rubocop/cop/performance/lstrip_rstrip.rb +9 -6
- data/lib/rubocop/cop/performance/range_include.rb +3 -3
- data/lib/rubocop/cop/performance/redundant_block_call.rb +28 -28
- data/lib/rubocop/cop/performance/redundant_match.rb +13 -12
- data/lib/rubocop/cop/performance/redundant_merge.rb +44 -26
- data/lib/rubocop/cop/performance/redundant_sort_by.rb +9 -6
- data/lib/rubocop/cop/performance/regexp_match.rb +19 -10
- data/lib/rubocop/cop/performance/reverse_each.rb +1 -1
- data/lib/rubocop/cop/performance/sample.rb +1 -1
- data/lib/rubocop/cop/performance/size.rb +3 -3
- data/lib/rubocop/cop/performance/start_with.rb +6 -6
- data/lib/rubocop/cop/performance/string_replacement.rb +6 -6
- data/lib/rubocop/cop/performance/times_map.rb +32 -22
- data/lib/rubocop/cop/performance/unfreeze_string.rb +50 -0
- data/lib/rubocop/cop/performance/uri_default_parser.rb +47 -0
- data/lib/rubocop/cop/rails/action_filter.rb +23 -1
- data/lib/rubocop/cop/rails/active_support_aliases.rb +4 -5
- data/lib/rubocop/cop/rails/application_job.rb +5 -3
- data/lib/rubocop/cop/rails/application_record.rb +5 -3
- data/lib/rubocop/cop/rails/blank.rb +20 -17
- data/lib/rubocop/cop/rails/create_table_with_timestamps.rb +82 -0
- data/lib/rubocop/cop/rails/date.rb +7 -6
- data/lib/rubocop/cop/rails/delegate.rb +53 -29
- data/lib/rubocop/cop/rails/delegate_allow_blank.rb +4 -4
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +2 -2
- data/lib/rubocop/cop/rails/enum_uniqueness.rb +4 -4
- data/lib/rubocop/cop/rails/environment_comparison.rb +66 -0
- data/lib/rubocop/cop/rails/exit.rb +8 -1
- data/lib/rubocop/cop/rails/file_path.rb +8 -11
- data/lib/rubocop/cop/rails/find_by.rb +2 -1
- data/lib/rubocop/cop/rails/find_each.rb +1 -1
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +8 -1
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +76 -0
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +40 -44
- data/lib/rubocop/cop/rails/inverse_of.rb +96 -0
- data/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb +112 -0
- data/lib/rubocop/cop/rails/not_null_column.rb +6 -6
- data/lib/rubocop/cop/rails/output.rb +11 -2
- data/lib/rubocop/cop/rails/output_safety.rb +16 -21
- data/lib/rubocop/cop/rails/pluralization_grammar.rb +10 -10
- data/lib/rubocop/cop/rails/presence.rb +105 -0
- data/lib/rubocop/cop/rails/present.rb +14 -17
- data/lib/rubocop/cop/rails/read_write_attribute.rb +13 -13
- data/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +91 -0
- data/lib/rubocop/cop/rails/relative_date_constant.rb +11 -11
- data/lib/rubocop/cop/rails/request_referer.rb +3 -3
- data/lib/rubocop/cop/rails/reversible_migration.rb +36 -35
- data/lib/rubocop/cop/rails/safe_navigation.rb +7 -8
- data/lib/rubocop/cop/rails/save_bang.rb +19 -17
- data/lib/rubocop/cop/rails/scope_args.rb +2 -2
- data/lib/rubocop/cop/rails/skips_model_validations.rb +2 -2
- data/lib/rubocop/cop/rails/time_zone.rb +3 -2
- data/lib/rubocop/cop/rails/uniq_before_pluck.rb +4 -2
- data/lib/rubocop/cop/rails/unknown_env.rb +63 -0
- data/lib/rubocop/cop/rails/validation.rb +8 -8
- data/lib/rubocop/cop/registry.rb +2 -1
- data/lib/rubocop/cop/security/eval.rb +4 -4
- data/lib/rubocop/cop/security/json_load.rb +7 -5
- data/lib/rubocop/cop/security/marshal_load.rb +8 -6
- data/lib/rubocop/cop/security/yaml_load.rb +4 -4
- data/lib/rubocop/cop/style/alias.rb +49 -27
- data/lib/rubocop/cop/style/and_or.rb +65 -45
- data/lib/rubocop/cop/style/array_join.rb +10 -1
- data/lib/rubocop/cop/style/ascii_comments.rb +24 -4
- data/lib/rubocop/cop/style/attr.rb +15 -5
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +7 -5
- data/lib/rubocop/cop/style/bare_percent_literals.rb +31 -10
- data/lib/rubocop/cop/style/begin_block.rb +1 -1
- data/lib/rubocop/cop/style/block_comments.rb +17 -3
- data/lib/rubocop/cop/style/block_delimiters.rb +82 -16
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +68 -32
- data/lib/rubocop/cop/style/case_equality.rb +13 -1
- data/lib/rubocop/cop/style/character_literal.rb +10 -0
- data/lib/rubocop/cop/style/class_and_module_children.rb +8 -4
- data/lib/rubocop/cop/style/class_check.rb +29 -10
- data/lib/rubocop/cop/style/class_methods.rb +10 -9
- data/lib/rubocop/cop/style/class_vars.rb +5 -4
- data/lib/rubocop/cop/style/collection_methods.rb +5 -3
- data/lib/rubocop/cop/style/colon_method_call.rb +18 -2
- data/lib/rubocop/cop/style/colon_method_definition.rb +36 -0
- data/lib/rubocop/cop/style/command_literal.rb +90 -30
- data/lib/rubocop/cop/style/comment_annotation.rb +39 -11
- data/lib/rubocop/cop/style/commented_keyword.rb +84 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +41 -41
- data/lib/rubocop/cop/style/copyright.rb +27 -28
- data/lib/rubocop/cop/style/date_time.rb +44 -0
- data/lib/rubocop/cop/style/def_with_parentheses.rb +31 -5
- data/lib/rubocop/cop/style/dir.rb +48 -0
- data/lib/rubocop/cop/style/documentation.rb +17 -2
- data/lib/rubocop/cop/style/documentation_method.rb +2 -6
- data/lib/rubocop/cop/style/double_negation.rb +1 -1
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +8 -8
- data/lib/rubocop/cop/style/each_with_object.rb +6 -5
- data/lib/rubocop/cop/style/empty_block_parameter.rb +47 -0
- data/lib/rubocop/cop/style/empty_case_condition.rb +3 -3
- data/lib/rubocop/cop/style/empty_else.rb +55 -24
- data/lib/rubocop/cop/style/empty_lambda_parameter.rb +43 -0
- data/lib/rubocop/cop/style/empty_literal.rb +25 -14
- data/lib/rubocop/cop/style/empty_method.rb +29 -25
- data/lib/rubocop/cop/style/encoding.rb +8 -51
- data/lib/rubocop/cop/style/end_block.rb +1 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +146 -0
- data/lib/rubocop/cop/style/even_odd.rb +4 -2
- data/lib/rubocop/cop/style/extend_self.rb +92 -0
- data/lib/rubocop/cop/style/flip_flop.rb +13 -2
- data/lib/rubocop/cop/style/for.rb +6 -2
- data/lib/rubocop/cop/style/format_string.rb +33 -5
- data/lib/rubocop/cop/style/format_string_token.rb +17 -15
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +7 -6
- data/lib/rubocop/cop/style/global_vars.rb +12 -2
- data/lib/rubocop/cop/style/guard_clause.rb +6 -4
- data/lib/rubocop/cop/style/hash_syntax.rb +56 -56
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +12 -8
- data/lib/rubocop/cop/style/if_inside_else.rb +11 -11
- data/lib/rubocop/cop/style/if_unless_modifier.rb +8 -7
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +3 -2
- data/lib/rubocop/cop/style/if_with_semicolon.rb +10 -1
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +7 -6
- data/lib/rubocop/cop/style/infinite_loop.rb +4 -4
- data/lib/rubocop/cop/style/inline_comment.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +24 -14
- data/lib/rubocop/cop/style/lambda.rb +45 -43
- data/lib/rubocop/cop/style/lambda_call.rb +37 -10
- data/lib/rubocop/cop/style/line_end_concatenation.rb +5 -5
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +3 -19
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +6 -4
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +1 -1
- data/lib/rubocop/cop/style/method_def_parentheses.rb +20 -25
- data/lib/rubocop/cop/style/method_missing.rb +13 -26
- data/lib/rubocop/cop/style/min_max.rb +68 -0
- data/lib/rubocop/cop/style/missing_else.rb +20 -6
- data/lib/rubocop/cop/style/mixin_grouping.rb +31 -21
- data/lib/rubocop/cop/style/mixin_usage.rb +71 -0
- data/lib/rubocop/cop/style/module_function.rb +27 -11
- data/lib/rubocop/cop/style/multiline_block_chain.rb +1 -1
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +8 -4
- data/lib/rubocop/cop/style/multiline_if_then.rb +15 -13
- data/lib/rubocop/cop/style/multiline_memoization.rb +33 -17
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +11 -15
- data/lib/rubocop/cop/style/negated_if.rb +27 -31
- data/lib/rubocop/cop/style/negated_while.rb +1 -5
- data/lib/rubocop/cop/style/nested_modifier.rb +1 -1
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +26 -23
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/next.rb +41 -12
- data/lib/rubocop/cop/style/nil_comparison.rb +8 -8
- data/lib/rubocop/cop/style/non_nil_check.rb +41 -38
- data/lib/rubocop/cop/style/not.rb +15 -5
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +8 -4
- data/lib/rubocop/cop/style/numeric_literals.rb +9 -9
- data/lib/rubocop/cop/style/numeric_predicate.rb +21 -21
- data/lib/rubocop/cop/style/one_line_conditional.rb +9 -4
- data/lib/rubocop/cop/style/option_hash.rb +11 -25
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -2
- data/lib/rubocop/cop/style/or_assignment.rb +88 -0
- data/lib/rubocop/cop/style/parallel_assignment.rb +16 -16
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +30 -13
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +25 -4
- data/lib/rubocop/cop/style/percent_q_literals.rb +29 -8
- data/lib/rubocop/cop/style/perl_backrefs.rb +8 -1
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +7 -11
- data/lib/rubocop/cop/style/proc.rb +10 -2
- data/lib/rubocop/cop/style/raise_args.rb +22 -29
- data/lib/rubocop/cop/style/random_with_offset.rb +160 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +16 -5
- data/lib/rubocop/cop/style/redundant_conditional.rb +96 -0
- data/lib/rubocop/cop/style/redundant_exception.rb +4 -4
- data/lib/rubocop/cop/style/redundant_freeze.rb +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +14 -12
- data/lib/rubocop/cop/style/redundant_return.rb +28 -15
- data/lib/rubocop/cop/style/redundant_self.rb +35 -27
- data/lib/rubocop/cop/style/regexp_literal.rb +88 -27
- data/lib/rubocop/cop/style/rescue_modifier.rb +12 -1
- data/lib/rubocop/cop/style/rescue_standard_error.rb +122 -0
- data/lib/rubocop/cop/style/return_nil.rb +89 -0
- data/lib/rubocop/cop/style/safe_navigation.rb +100 -48
- data/lib/rubocop/cop/style/self_assignment.rb +13 -13
- data/lib/rubocop/cop/style/semicolon.rb +19 -9
- data/lib/rubocop/cop/style/send.rb +10 -1
- data/lib/rubocop/cop/style/signal_exception.rb +104 -3
- data/lib/rubocop/cop/style/single_line_block_params.rb +16 -15
- data/lib/rubocop/cop/style/single_line_methods.rb +26 -18
- data/lib/rubocop/cop/style/special_global_vars.rb +19 -14
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +23 -50
- data/lib/rubocop/cop/style/stderr_puts.rb +54 -0
- data/lib/rubocop/cop/style/string_hash_keys.rb +36 -0
- data/lib/rubocop/cop/style/string_literals.rb +26 -3
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +16 -1
- data/lib/rubocop/cop/style/string_methods.rb +19 -8
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -3
- data/lib/rubocop/cop/style/symbol_array.rb +7 -35
- data/lib/rubocop/cop/style/symbol_literal.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +11 -25
- data/lib/rubocop/cop/style/ternary_parentheses.rb +46 -51
- data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +101 -0
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +20 -6
- data/lib/rubocop/cop/style/trailing_comma_in_literal.rb +22 -7
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +95 -0
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +70 -24
- data/lib/rubocop/cop/style/trivial_accessors.rb +72 -65
- data/lib/rubocop/cop/style/unless_else.rb +16 -1
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +18 -8
- data/lib/rubocop/cop/style/unneeded_interpolation.rb +15 -19
- data/lib/rubocop/cop/style/unneeded_percent_q.rb +14 -13
- data/lib/rubocop/cop/style/variable_interpolation.rb +23 -9
- data/lib/rubocop/cop/style/when_then.rb +14 -1
- data/lib/rubocop/cop/style/while_until_do.rb +27 -4
- data/lib/rubocop/cop/style/while_until_modifier.rb +26 -6
- data/lib/rubocop/cop/style/word_array.rb +9 -30
- data/lib/rubocop/cop/style/yoda_condition.rb +51 -22
- data/lib/rubocop/cop/style/zero_length_predicate.rb +44 -29
- data/lib/rubocop/cop/team.rb +16 -8
- data/lib/rubocop/cop/util.rb +43 -34
- data/lib/rubocop/cop/variable_force.rb +1 -1
- data/lib/rubocop/cop/variable_force/assignment.rb +4 -2
- data/lib/rubocop/cop/variable_force/scope.rb +1 -5
- data/lib/rubocop/cop/variable_force/variable.rb +1 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +3 -4
- data/lib/rubocop/formatter/formatter_set.rb +3 -1
- data/lib/rubocop/formatter/html_formatter.rb +1 -1
- data/lib/rubocop/formatter/json_formatter.rb +9 -3
- data/lib/rubocop/formatter/offense_count_formatter.rb +2 -0
- data/lib/rubocop/formatter/quiet_formatter.rb +13 -0
- data/lib/rubocop/formatter/simple_text_formatter.rb +3 -3
- data/lib/rubocop/formatter/tap_formatter.rb +71 -0
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +2 -0
- data/lib/rubocop/node_pattern.rb +46 -29
- data/lib/rubocop/options.rb +13 -8
- data/lib/rubocop/path_util.rb +15 -3
- data/lib/rubocop/processed_source.rb +8 -9
- data/lib/rubocop/rake_task.rb +16 -23
- data/lib/rubocop/remote_config.rb +13 -1
- data/lib/rubocop/result_cache.rb +1 -0
- data/lib/rubocop/rspec/cop_helper.rb +10 -10
- data/lib/rubocop/rspec/expect_offense.rb +6 -8
- data/lib/rubocop/rspec/shared_contexts.rb +4 -8
- data/lib/rubocop/rspec/shared_examples.rb +8 -8
- data/lib/rubocop/rspec/support.rb +5 -5
- data/lib/rubocop/runner.rb +1 -1
- data/lib/rubocop/string_util.rb +2 -0
- data/lib/rubocop/token.rb +74 -0
- data/lib/rubocop/version.rb +1 -1
- metadata +118 -48
- data/lib/rubocop/cop/layout/space_inside_brackets.rb +0 -20
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +0 -41
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +0 -41
- data/lib/rubocop/cop/mixin/on_method_def.rb +0 -44
- data/lib/rubocop/cop/mixin/space_inside.rb +0 -76
- data/lib/rubocop/cop/style/accessor_method_name.rb +0 -45
- data/lib/rubocop/cop/style/class_and_module_camel_case.rb +0 -29
- data/lib/rubocop/cop/style/constant_name.rb +0 -29
- data/lib/rubocop/cop/style/method_name.rb +0 -34
- data/lib/rubocop/cop/style/predicate_name.rb +0 -67
- data/lib/rubocop/cop/style/variable_name.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbbe943a5ed0fd35d07ba728c5569d279eaffbb8
|
4
|
+
data.tar.gz: 0fd2d58d865e457479f1d6ce0d8f12c7cda1dba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4253ebe0cf732ca876078c01852f99cbfb9cc44f8bdb053bc368f6d18839c90152b87322738c052e15b8b128fa4a2e7f85902d8445d961b21df232a3b4fbb184
|
7
|
+
data.tar.gz: 9deb27503042d598d22d3f748a72fea9900b37a4fb95400180fada165e4ee393631d1b53456230d1a0aa1a69b8d26899c2b2e6253363912f2813de1eb6ac9f7b
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[](http://badge.fury.io/rb/rubocop)
|
2
2
|
[](https://gemnasium.com/bbatsov/rubocop)
|
3
3
|
[](https://travis-ci.org/bbatsov/rubocop)
|
4
|
-
[](https://ci.appveyor.com/project/bbatsov/rubocop)
|
5
5
|
[](https://codeclimate.com/github/bbatsov/rubocop)
|
6
6
|
[](https://codeclimate.com/github/bbatsov/rubocop)
|
7
7
|
[](http://inch-ci.org/github/bbatsov/rubocop)
|
@@ -51,7 +51,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
|
|
51
51
|
might want to use a conservative version locking in your `Gemfile`:
|
52
52
|
|
53
53
|
```rb
|
54
|
-
gem 'rubocop', '~> 0.
|
54
|
+
gem 'rubocop', '~> 0.52.0', require: false
|
55
55
|
```
|
56
56
|
|
57
57
|
## Quickstart
|
@@ -71,13 +71,8 @@ You can read a ton more about RuboCop in its [official manual](http://rubocop.re
|
|
71
71
|
|
72
72
|
RuboCop supports the following Ruby implementations:
|
73
73
|
|
74
|
-
* MRI 2.
|
75
|
-
* MRI 2.1
|
76
|
-
* MRI 2.2
|
77
|
-
* MRI 2.3
|
78
|
-
* MRI 2.4
|
74
|
+
* MRI 2.1+
|
79
75
|
* JRuby 9.0+
|
80
|
-
* Rubinius 2.0+
|
81
76
|
|
82
77
|
## Team
|
83
78
|
|
@@ -86,7 +81,9 @@ Here's a list of RuboCop's core developers:
|
|
86
81
|
* [Bozhidar Batsov](https://github.com/bbatsov)
|
87
82
|
* [Jonas Arvidsson](https://github.com/jonas054)
|
88
83
|
* [Yuji Nakayama](https://github.com/yujinakayama)
|
89
|
-
* [Evgeni Dzhelyov](https://github.com/edzhelyov)
|
84
|
+
* [Evgeni Dzhelyov](https://github.com/edzhelyov) (retired)
|
85
|
+
* [Ted Johansson](https://github.com/drenmi)
|
86
|
+
* [Masataka Kuwabara](https://github.com/pocke)
|
90
87
|
|
91
88
|
## Logo
|
92
89
|
|
data/bin/rubocop
CHANGED
data/config/default.yml
CHANGED
@@ -55,13 +55,14 @@ AllCops:
|
|
55
55
|
- '**/Vagabondfile'
|
56
56
|
- '**/Vagrantfile'
|
57
57
|
Exclude:
|
58
|
+
- 'node_modules/**/*'
|
58
59
|
- 'vendor/**/*'
|
59
60
|
# Default formatter will be used if no `-f/--format` option is given.
|
60
61
|
DefaultFormatter: progress
|
61
|
-
# Cop names are
|
62
|
-
# by overriding DisplayCopNames, or by giving the
|
62
|
+
# Cop names are displayed in offense messages by default. Change behavior
|
63
|
+
# by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
|
63
64
|
# option.
|
64
|
-
DisplayCopNames:
|
65
|
+
DisplayCopNames: true
|
65
66
|
# Style guide URLs are not displayed in offense messages by default. Change
|
66
67
|
# behavior by overriding `DisplayStyleGuide`, or by giving the
|
67
68
|
# `-S/--display-style-guide` option.
|
@@ -489,6 +490,10 @@ Layout/SpaceBeforeBlockBraces:
|
|
489
490
|
SupportedStyles:
|
490
491
|
- space
|
491
492
|
- no_space
|
493
|
+
EnforcedStyleForEmptyBraces: no_space
|
494
|
+
SupportedStylesForEmptyBraces:
|
495
|
+
- space
|
496
|
+
- no_space
|
492
497
|
|
493
498
|
Layout/SpaceBeforeFirstArg:
|
494
499
|
# When `true`, allows most uses of extra spacing if the intent is to align
|
@@ -496,6 +501,19 @@ Layout/SpaceBeforeFirstArg:
|
|
496
501
|
# lines.
|
497
502
|
AllowForAlignment: true
|
498
503
|
|
504
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
505
|
+
EnforcedStyle: no_space
|
506
|
+
SupportedStyles:
|
507
|
+
- space
|
508
|
+
- no_space
|
509
|
+
# 'compact' normally requires a space inside the brackets, with the exception
|
510
|
+
# that successive left brackets or right brackets are collapsed together
|
511
|
+
- compact
|
512
|
+
EnforcedStyleForEmptyBrackets: no_space
|
513
|
+
SupportedStylesForEmptyBrackets:
|
514
|
+
- space
|
515
|
+
- no_space
|
516
|
+
|
499
517
|
Layout/SpaceInsideBlockBraces:
|
500
518
|
EnforcedStyle: space
|
501
519
|
SupportedStyles:
|
@@ -521,18 +539,165 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
521
539
|
- space
|
522
540
|
- no_space
|
523
541
|
|
542
|
+
Layout/SpaceInsideReferenceBrackets:
|
543
|
+
EnforcedStyle: no_space
|
544
|
+
SupportedStyles:
|
545
|
+
- space
|
546
|
+
- no_space
|
547
|
+
|
524
548
|
Layout/SpaceInsideStringInterpolation:
|
525
549
|
EnforcedStyle: no_space
|
526
550
|
SupportedStyles:
|
527
551
|
- space
|
528
552
|
- no_space
|
529
553
|
|
554
|
+
Layout/ClassStructure:
|
555
|
+
Description: 'Enforces a configured order of definitions within a class body.'
|
556
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-classes'
|
557
|
+
Enabled: false
|
558
|
+
Categories:
|
559
|
+
module_inclusion:
|
560
|
+
- include
|
561
|
+
- prepend
|
562
|
+
- extend
|
563
|
+
ExpectedOrder:
|
564
|
+
- module_inclusion
|
565
|
+
- constants
|
566
|
+
- public_class_methods
|
567
|
+
- initializer
|
568
|
+
- public_methods
|
569
|
+
- protected_methods
|
570
|
+
- private_methods
|
571
|
+
|
572
|
+
Layout/Tab:
|
573
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
574
|
+
# But it can be overridden by setting this parameter
|
575
|
+
# It is used during auto-correction to determine how many spaces should
|
576
|
+
# replace each tab.
|
577
|
+
IndentationWidth: ~
|
578
|
+
|
530
579
|
Layout/TrailingBlankLines:
|
531
580
|
EnforcedStyle: final_newline
|
532
581
|
SupportedStyles:
|
533
582
|
- final_newline
|
534
583
|
- final_blank_line
|
535
584
|
|
585
|
+
#################### Naming ##########################
|
586
|
+
|
587
|
+
Naming/FileName:
|
588
|
+
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
589
|
+
# excludes here.
|
590
|
+
Exclude: []
|
591
|
+
# When `true`, requires that each source file should define a class or module
|
592
|
+
# with a name which matches the file name (converted to ... case).
|
593
|
+
# It further expects it to be nested inside modules which match the names
|
594
|
+
# of subdirectories in its path.
|
595
|
+
ExpectMatchingDefinition: false
|
596
|
+
# If non-`nil`, expect all source file names to match the following regex.
|
597
|
+
# Only the file name itself is matched, not the entire file path.
|
598
|
+
# Use anchors as necessary if you want to match the entire name rather than
|
599
|
+
# just a part of it.
|
600
|
+
Regex: ~
|
601
|
+
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
602
|
+
# report offending filenames for executable scripts (i.e. source
|
603
|
+
# files with a shebang in the first line).
|
604
|
+
IgnoreExecutableScripts: true
|
605
|
+
AllowedAcronyms:
|
606
|
+
- CLI
|
607
|
+
- DSL
|
608
|
+
- ACL
|
609
|
+
- API
|
610
|
+
- ASCII
|
611
|
+
- CPU
|
612
|
+
- CSS
|
613
|
+
- DNS
|
614
|
+
- EOF
|
615
|
+
- GUID
|
616
|
+
- HTML
|
617
|
+
- HTTP
|
618
|
+
- HTTPS
|
619
|
+
- ID
|
620
|
+
- IP
|
621
|
+
- JSON
|
622
|
+
- LHS
|
623
|
+
- QPS
|
624
|
+
- RAM
|
625
|
+
- RHS
|
626
|
+
- RPC
|
627
|
+
- SLA
|
628
|
+
- SMTP
|
629
|
+
- SQL
|
630
|
+
- SSH
|
631
|
+
- TCP
|
632
|
+
- TLS
|
633
|
+
- TTL
|
634
|
+
- UDP
|
635
|
+
- UI
|
636
|
+
- UID
|
637
|
+
- UUID
|
638
|
+
- URI
|
639
|
+
- URL
|
640
|
+
- UTF8
|
641
|
+
- VM
|
642
|
+
- XML
|
643
|
+
- XMPP
|
644
|
+
- XSRF
|
645
|
+
- XSS
|
646
|
+
|
647
|
+
Naming/HeredocDelimiterNaming:
|
648
|
+
Blacklist:
|
649
|
+
- END
|
650
|
+
- !ruby/regexp '/EO[A-Z]{1}/'
|
651
|
+
|
652
|
+
Naming/HeredocDelimiterCase:
|
653
|
+
EnforcedStyle: uppercase
|
654
|
+
SupportedStyles:
|
655
|
+
- lowercase
|
656
|
+
- uppercase
|
657
|
+
|
658
|
+
Naming/MethodName:
|
659
|
+
EnforcedStyle: snake_case
|
660
|
+
SupportedStyles:
|
661
|
+
- snake_case
|
662
|
+
- camelCase
|
663
|
+
|
664
|
+
Naming/PredicateName:
|
665
|
+
# Predicate name prefixes.
|
666
|
+
NamePrefix:
|
667
|
+
- is_
|
668
|
+
- has_
|
669
|
+
- have_
|
670
|
+
# Predicate name prefixes that should be removed.
|
671
|
+
NamePrefixBlacklist:
|
672
|
+
- is_
|
673
|
+
- has_
|
674
|
+
- have_
|
675
|
+
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
676
|
+
# should still be accepted
|
677
|
+
NameWhitelist:
|
678
|
+
- is_a?
|
679
|
+
# Method definition macros for dynamically generated methods.
|
680
|
+
MethodDefinitionMacros:
|
681
|
+
- define_method
|
682
|
+
- define_singleton_method
|
683
|
+
# Exclude Rspec specs because there is a strong convention to write spec
|
684
|
+
# helpers in the form of `have_something` or `be_something`.
|
685
|
+
Exclude:
|
686
|
+
- 'spec/**/*'
|
687
|
+
|
688
|
+
Naming/VariableName:
|
689
|
+
EnforcedStyle: snake_case
|
690
|
+
SupportedStyles:
|
691
|
+
- snake_case
|
692
|
+
- camelCase
|
693
|
+
|
694
|
+
Naming/VariableNumber:
|
695
|
+
EnforcedStyle: normalcase
|
696
|
+
SupportedStyles:
|
697
|
+
- snake_case
|
698
|
+
- normalcase
|
699
|
+
- non_integer
|
700
|
+
|
536
701
|
#################### Style ###########################
|
537
702
|
|
538
703
|
Style/Alias:
|
@@ -549,6 +714,9 @@ Style/AndOr:
|
|
549
714
|
- always
|
550
715
|
- conditionals
|
551
716
|
|
717
|
+
Style/AsciiComments:
|
718
|
+
AllowedChars: []
|
719
|
+
|
552
720
|
# Checks if usage of `%()` or `%Q()` matches configuration.
|
553
721
|
Style/BarePercentLiterals:
|
554
722
|
EnforcedStyle: bare_percent
|
@@ -762,76 +930,11 @@ Style/EmptyMethod:
|
|
762
930
|
- compact
|
763
931
|
- expanded
|
764
932
|
|
765
|
-
|
766
|
-
|
767
|
-
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
768
|
-
Style/Encoding:
|
769
|
-
EnforcedStyle: never
|
933
|
+
Style/ExtendSelf:
|
934
|
+
EnforcedStyle: module_function
|
770
935
|
SupportedStyles:
|
771
|
-
-
|
772
|
-
-
|
773
|
-
- never
|
774
|
-
AutoCorrectEncodingComment: '# encoding: utf-8'
|
775
|
-
|
776
|
-
Style/FileName:
|
777
|
-
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
778
|
-
# excludes here.
|
779
|
-
Exclude: []
|
780
|
-
# When `true`, requires that each source file should define a class or module
|
781
|
-
# with a name which matches the file name (converted to ... case).
|
782
|
-
# It further expects it to be nested inside modules which match the names
|
783
|
-
# of subdirectories in its path.
|
784
|
-
ExpectMatchingDefinition: false
|
785
|
-
# If non-`nil`, expect all source file names to match the following regex.
|
786
|
-
# Only the file name itself is matched, not the entire file path.
|
787
|
-
# Use anchors as necessary if you want to match the entire name rather than
|
788
|
-
# just a part of it.
|
789
|
-
Regex: ~
|
790
|
-
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
791
|
-
# report offending filenames for executable scripts (i.e. source
|
792
|
-
# files with a shebang in the first line).
|
793
|
-
IgnoreExecutableScripts: true
|
794
|
-
AllowedAcronyms:
|
795
|
-
- CLI
|
796
|
-
- DSL
|
797
|
-
- ACL
|
798
|
-
- API
|
799
|
-
- ASCII
|
800
|
-
- CPU
|
801
|
-
- CSS
|
802
|
-
- DNS
|
803
|
-
- EOF
|
804
|
-
- GUID
|
805
|
-
- HTML
|
806
|
-
- HTTP
|
807
|
-
- HTTPS
|
808
|
-
- ID
|
809
|
-
- IP
|
810
|
-
- JSON
|
811
|
-
- LHS
|
812
|
-
- QPS
|
813
|
-
- RAM
|
814
|
-
- RHS
|
815
|
-
- RPC
|
816
|
-
- SLA
|
817
|
-
- SMTP
|
818
|
-
- SQL
|
819
|
-
- SSH
|
820
|
-
- TCP
|
821
|
-
- TLS
|
822
|
-
- TTL
|
823
|
-
- UDP
|
824
|
-
- UI
|
825
|
-
- UID
|
826
|
-
- UUID
|
827
|
-
- URI
|
828
|
-
- URL
|
829
|
-
- UTF8
|
830
|
-
- VM
|
831
|
-
- XML
|
832
|
-
- XMPP
|
833
|
-
- XSRF
|
834
|
-
- XSS
|
936
|
+
- module_function
|
937
|
+
- extend_self
|
835
938
|
|
836
939
|
# Checks use of for or each in multiline loops.
|
837
940
|
Style/For:
|
@@ -857,6 +960,7 @@ Style/FormatStringToken:
|
|
857
960
|
- annotated
|
858
961
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
859
962
|
- template
|
963
|
+
- unannotated
|
860
964
|
|
861
965
|
Style/FrozenStringLiteralComment:
|
862
966
|
EnforcedStyle: when_needed
|
@@ -898,9 +1002,6 @@ Style/HashSyntax:
|
|
898
1002
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
899
1003
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
900
1004
|
|
901
|
-
Style/IfUnlessModifier:
|
902
|
-
MaxLineLength: 80
|
903
|
-
|
904
1005
|
Style/InverseMethods:
|
905
1006
|
Enabled: true
|
906
1007
|
# `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
|
@@ -947,12 +1048,6 @@ Style/MethodDefParentheses:
|
|
947
1048
|
- require_no_parentheses
|
948
1049
|
- require_no_parentheses_except_multiline
|
949
1050
|
|
950
|
-
Style/MethodName:
|
951
|
-
EnforcedStyle: snake_case
|
952
|
-
SupportedStyles:
|
953
|
-
- snake_case
|
954
|
-
- camelCase
|
955
|
-
|
956
1051
|
# Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
|
957
1052
|
# `module` bodies.
|
958
1053
|
Style/MixinGrouping:
|
@@ -985,6 +1080,26 @@ Style/NegatedIf:
|
|
985
1080
|
- prefix
|
986
1081
|
- postfix
|
987
1082
|
|
1083
|
+
Style/NestedParenthesizedCalls:
|
1084
|
+
Whitelist:
|
1085
|
+
- be
|
1086
|
+
- be_a
|
1087
|
+
- be_an
|
1088
|
+
- be_between
|
1089
|
+
- be_falsey
|
1090
|
+
- be_kind_of
|
1091
|
+
- be_instance_of
|
1092
|
+
- be_truthy
|
1093
|
+
- be_within
|
1094
|
+
- eq
|
1095
|
+
- eql
|
1096
|
+
- end_with
|
1097
|
+
- include
|
1098
|
+
- match
|
1099
|
+
- raise_error
|
1100
|
+
- respond_to
|
1101
|
+
- start_with
|
1102
|
+
|
988
1103
|
Style/Next:
|
989
1104
|
# With `always` all conditions at the end of an iteration needs to be
|
990
1105
|
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
@@ -1057,26 +1172,6 @@ Style/PercentQLiterals:
|
|
1057
1172
|
- lower_case_q # Use `%q` when possible, `%Q` when necessary
|
1058
1173
|
- upper_case_q # Always use `%Q`
|
1059
1174
|
|
1060
|
-
Style/PredicateName:
|
1061
|
-
# Predicate name prefixes.
|
1062
|
-
NamePrefix:
|
1063
|
-
- is_
|
1064
|
-
- has_
|
1065
|
-
- have_
|
1066
|
-
# Predicate name prefixes that should be removed.
|
1067
|
-
NamePrefixBlacklist:
|
1068
|
-
- is_
|
1069
|
-
- has_
|
1070
|
-
- have_
|
1071
|
-
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
1072
|
-
# should still be accepted
|
1073
|
-
NameWhitelist:
|
1074
|
-
- is_a?
|
1075
|
-
# Exclude Rspec specs because there is a strong convention to write spec
|
1076
|
-
# helpers in the form of `have_something` or `be_something`.
|
1077
|
-
Exclude:
|
1078
|
-
- 'spec/**/*'
|
1079
|
-
|
1080
1175
|
Style/PreferredHashMethods:
|
1081
1176
|
EnforcedStyle: short
|
1082
1177
|
SupportedStyles:
|
@@ -1107,6 +1202,20 @@ Style/RegexpLiteral:
|
|
1107
1202
|
# are found in the regexp string.
|
1108
1203
|
AllowInnerSlashes: false
|
1109
1204
|
|
1205
|
+
Style/RescueStandardError:
|
1206
|
+
EnforcedStyle: explicit
|
1207
|
+
# implicit: Do not include the error class, `rescue`
|
1208
|
+
# explicit: Require an error class `rescue StandardError`
|
1209
|
+
SupportedStyles:
|
1210
|
+
- implicit
|
1211
|
+
- explicit
|
1212
|
+
|
1213
|
+
Style/ReturnNil:
|
1214
|
+
EnforcedStyle: return
|
1215
|
+
SupportedStyles:
|
1216
|
+
- return
|
1217
|
+
- return_nil
|
1218
|
+
|
1110
1219
|
Style/SafeNavigation:
|
1111
1220
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
1112
1221
|
# to whatever it used to return.
|
@@ -1258,22 +1367,6 @@ Style/TrivialAccessors:
|
|
1258
1367
|
- to_s
|
1259
1368
|
- to_sym
|
1260
1369
|
|
1261
|
-
Style/VariableName:
|
1262
|
-
EnforcedStyle: snake_case
|
1263
|
-
SupportedStyles:
|
1264
|
-
- snake_case
|
1265
|
-
- camelCase
|
1266
|
-
|
1267
|
-
Style/VariableNumber:
|
1268
|
-
EnforcedStyle: normalcase
|
1269
|
-
SupportedStyles:
|
1270
|
-
- snake_case
|
1271
|
-
- normalcase
|
1272
|
-
- non_integer
|
1273
|
-
|
1274
|
-
Style/WhileUntilModifier:
|
1275
|
-
MaxLineLength: 80
|
1276
|
-
|
1277
1370
|
# `WordArray` enforces how array literals of word-like strings should be expressed.
|
1278
1371
|
Style/WordArray:
|
1279
1372
|
EnforcedStyle: percent
|
@@ -1289,6 +1382,14 @@ Style/WordArray:
|
|
1289
1382
|
# The regular expression `WordRegex` decides what is considered a word.
|
1290
1383
|
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
|
1291
1384
|
|
1385
|
+
Style/YodaCondition:
|
1386
|
+
EnforcedStyle: all_comparison_operators
|
1387
|
+
SupportedStyles:
|
1388
|
+
# check all comparison operators
|
1389
|
+
- all_comparison_operators
|
1390
|
+
# check only equality operators: `!=` and `==`
|
1391
|
+
- equality_operators_only
|
1392
|
+
|
1292
1393
|
#################### Metrics ###############################
|
1293
1394
|
|
1294
1395
|
Metrics/AbcSize:
|
@@ -1398,6 +1499,16 @@ Lint/InheritException:
|
|
1398
1499
|
- runtime_error
|
1399
1500
|
- standard_error
|
1400
1501
|
|
1502
|
+
Lint/MissingCopEnableDirective:
|
1503
|
+
# Maximum number of consecutive lines the cop can be disabled for.
|
1504
|
+
# 0 allows only single-line disables
|
1505
|
+
# 1 would mean the maximum allowed is the following:
|
1506
|
+
# # rubocop:disable SomeCop
|
1507
|
+
# a = 1
|
1508
|
+
# # rubocop:enable SomeCop
|
1509
|
+
# .inf for any size
|
1510
|
+
MaximumRangeSize: .inf
|
1511
|
+
|
1401
1512
|
Lint/SafeNavigationChain:
|
1402
1513
|
Whitelist:
|
1403
1514
|
- present?
|
@@ -1405,6 +1516,10 @@ Lint/SafeNavigationChain:
|
|
1405
1516
|
- presence
|
1406
1517
|
- try
|
1407
1518
|
|
1519
|
+
# Checks for shadowed arguments
|
1520
|
+
Lint/ShadowedArgument:
|
1521
|
+
IgnoreImplicitReferences: false
|
1522
|
+
|
1408
1523
|
# Checks for unused block arguments
|
1409
1524
|
Lint/UnusedBlockArgument:
|
1410
1525
|
IgnoreEmptyBlocks: true
|
@@ -1436,6 +1551,10 @@ Rails/ActionFilter:
|
|
1436
1551
|
Include:
|
1437
1552
|
- app/controllers/**/*.rb
|
1438
1553
|
|
1554
|
+
Rails/CreateTableWithTimestamps:
|
1555
|
+
Include:
|
1556
|
+
- db/migrate/*.rb
|
1557
|
+
|
1439
1558
|
Rails/Date:
|
1440
1559
|
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
1441
1560
|
# `Date#to_time` etc.
|
@@ -1447,6 +1566,12 @@ Rails/Date:
|
|
1447
1566
|
- strict
|
1448
1567
|
- flexible
|
1449
1568
|
|
1569
|
+
Rails/Delegate:
|
1570
|
+
# When set to true, using the target object as a prefix of the
|
1571
|
+
# method name without using the `delegate` method will be a
|
1572
|
+
# violation. When set to false, this case is legal.
|
1573
|
+
EnforceForPrefixed: true
|
1574
|
+
|
1450
1575
|
Rails/DynamicFindBy:
|
1451
1576
|
Whitelist:
|
1452
1577
|
- find_by_sql
|
@@ -1475,6 +1600,18 @@ Rails/HasAndBelongsToMany:
|
|
1475
1600
|
Include:
|
1476
1601
|
- app/models/**/*.rb
|
1477
1602
|
|
1603
|
+
Rails/HasManyOrHasOneDependent:
|
1604
|
+
Include:
|
1605
|
+
- app/models/**/*.rb
|
1606
|
+
|
1607
|
+
Rails/InverseOf:
|
1608
|
+
Include:
|
1609
|
+
- app/models/**/*.rb
|
1610
|
+
|
1611
|
+
Rails/LexicallyScopedActionFilter:
|
1612
|
+
Include:
|
1613
|
+
- app/controllers/**/*.rb
|
1614
|
+
|
1478
1615
|
Rails/NotNullColumn:
|
1479
1616
|
Include:
|
1480
1617
|
- db/migrate/*.rb
|
@@ -1502,7 +1639,7 @@ Rails/ReversibleMigration:
|
|
1502
1639
|
|
1503
1640
|
Rails/SafeNavigation:
|
1504
1641
|
# This will convert usages of `try` to use safe navigation as well as `try!`.
|
1505
|
-
# `try` and `try!` work
|
1642
|
+
# `try` and `try!` work slightly differently. `try!` and safe navigation will
|
1506
1643
|
# both raise a `NoMethodError` if the receiver of the method call does not
|
1507
1644
|
# implement the intended method. `try` will not raise an exception for this.
|
1508
1645
|
ConvertTry: false
|
@@ -1526,6 +1663,12 @@ Rails/UniqBeforePluck:
|
|
1526
1663
|
- aggressive
|
1527
1664
|
AutoCorrect: false
|
1528
1665
|
|
1666
|
+
Rails/UnknownEnv:
|
1667
|
+
Environments:
|
1668
|
+
- development
|
1669
|
+
- test
|
1670
|
+
- production
|
1671
|
+
|
1529
1672
|
Rails/SkipsModelValidations:
|
1530
1673
|
Blacklist:
|
1531
1674
|
- decrement!
|
@@ -1546,3 +1689,6 @@ Rails/Validation:
|
|
1546
1689
|
|
1547
1690
|
Bundler/OrderedGems:
|
1548
1691
|
TreatCommentsAsGroupSeparators: true
|
1692
|
+
|
1693
|
+
Gemspec/OrderedDependencies:
|
1694
|
+
TreatCommentsAsGroupSeparators: true
|