rubocop 0.42.0 → 0.52.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +106 -20
- data/assets/output.html.erb +21 -10
- data/bin/rubocop +1 -2
- data/config/default.yml +914 -483
- data/config/disabled.yml +61 -41
- data/config/enabled.yml +1396 -878
- data/lib/rubocop/ast/builder.rb +72 -0
- data/lib/rubocop/ast/node/and_node.rb +37 -0
- data/lib/rubocop/ast/node/args_node.rb +29 -0
- data/lib/rubocop/ast/node/array_node.rb +57 -0
- data/lib/rubocop/ast/node/block_node.rb +116 -0
- data/lib/rubocop/ast/node/case_node.rb +64 -0
- data/lib/rubocop/ast/node/def_node.rb +71 -0
- data/lib/rubocop/ast/node/ensure_node.rb +25 -0
- data/lib/rubocop/ast/node/for_node.rb +61 -0
- data/lib/rubocop/ast/node/hash_node.rb +109 -0
- data/lib/rubocop/ast/node/if_node.rb +146 -0
- data/lib/rubocop/ast/node/keyword_splat_node.rb +45 -0
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +16 -0
- data/lib/rubocop/ast/node/mixin/binary_operator_node.rb +23 -0
- data/lib/rubocop/ast/node/mixin/collection_node.rb +15 -0
- data/lib/rubocop/ast/node/mixin/conditional_node.rb +45 -0
- data/lib/rubocop/ast/node/mixin/hash_element_node.rb +125 -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/modifier_node.rb +17 -0
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +61 -0
- data/lib/rubocop/ast/node/mixin/predicate_operator_node.rb +35 -0
- data/lib/rubocop/ast/node/or_node.rb +37 -0
- data/lib/rubocop/ast/node/pair_node.rb +64 -0
- data/lib/rubocop/ast/node/regexp_node.rb +35 -0
- data/lib/rubocop/ast/node/resbody_node.rb +25 -0
- data/lib/rubocop/ast/node/send_node.rb +45 -0
- data/lib/rubocop/ast/node/str_node.rb +14 -0
- data/lib/rubocop/ast/node/super_node.rb +21 -0
- data/lib/rubocop/ast/node/symbol_node.rb +20 -0
- data/lib/rubocop/ast/node/until_node.rb +43 -0
- data/lib/rubocop/ast/node/when_node.rb +61 -0
- data/lib/rubocop/ast/node/while_node.rb +43 -0
- data/lib/rubocop/ast/node/yield_node.rb +21 -0
- data/lib/rubocop/ast/node.rb +634 -0
- data/lib/rubocop/ast/sexp.rb +16 -0
- data/lib/rubocop/{ast_node → ast}/traversal.rb +23 -24
- data/lib/rubocop/cached_data.rb +11 -31
- data/lib/rubocop/cli.rb +116 -33
- data/lib/rubocop/comment_config.rb +4 -10
- data/lib/rubocop/config.rb +355 -102
- data/lib/rubocop/config_loader.rb +93 -78
- data/lib/rubocop/config_loader_resolver.rb +106 -7
- data/lib/rubocop/config_store.rb +4 -1
- data/lib/rubocop/cop/autocorrect_logic.rb +1 -2
- data/lib/rubocop/cop/badge.rb +73 -0
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +71 -0
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +67 -0
- data/lib/rubocop/cop/bundler/ordered_gems.rb +71 -0
- data/lib/rubocop/cop/commissioner.rb +27 -10
- data/lib/rubocop/cop/cop.rb +62 -107
- data/lib/rubocop/cop/corrector.rb +0 -1
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +121 -0
- data/lib/rubocop/cop/correctors/condition_corrector.rb +28 -0
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +26 -0
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +62 -0
- data/lib/rubocop/cop/correctors/ordered_gem_corrector.rb +44 -0
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +31 -0
- data/lib/rubocop/cop/correctors/punctuation_corrector.rb +29 -0
- data/lib/rubocop/cop/correctors/space_corrector.rb +34 -0
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +25 -0
- data/lib/rubocop/cop/correctors/unused_arg_corrector.rb +31 -0
- data/lib/rubocop/cop/force.rb +0 -1
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +102 -0
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +106 -0
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +87 -0
- data/lib/rubocop/cop/generator/require_file_injector.rb +78 -0
- data/lib/rubocop/cop/generator.rb +191 -0
- data/lib/rubocop/cop/ignored_node.rb +0 -1
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +44 -0
- 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 +52 -0
- data/lib/rubocop/cop/internal_affairs.rb +8 -0
- data/lib/rubocop/cop/{style → layout}/access_modifier_indentation.rb +39 -10
- data/lib/rubocop/cop/layout/align_array.rb +39 -0
- data/lib/rubocop/cop/layout/align_hash.rb +235 -0
- data/lib/rubocop/cop/{style → layout}/align_parameters.rb +38 -19
- data/lib/rubocop/cop/{style → layout}/block_end_newline.rb +26 -8
- data/lib/rubocop/cop/layout/case_indentation.rb +160 -0
- data/lib/rubocop/cop/layout/class_structure.rb +306 -0
- data/lib/rubocop/cop/{style → layout}/closing_parenthesis_indentation.rb +18 -13
- data/lib/rubocop/cop/{style → layout}/comment_indentation.rb +48 -6
- data/lib/rubocop/cop/{style → layout}/dot_position.rb +34 -21
- data/lib/rubocop/cop/{style → layout}/else_alignment.rb +55 -37
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +63 -0
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +147 -0
- data/lib/rubocop/cop/{style → layout}/empty_lines.rb +17 -4
- data/lib/rubocop/cop/{style → layout}/empty_lines_around_access_modifier.rb +40 -24
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +87 -0
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +46 -0
- data/lib/rubocop/cop/{style → layout}/empty_lines_around_block_body.rb +9 -12
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +68 -0
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +135 -0
- data/lib/rubocop/cop/{style → layout}/empty_lines_around_method_body.rb +10 -7
- data/lib/rubocop/cop/{style → layout}/empty_lines_around_module_body.rb +27 -9
- data/lib/rubocop/cop/layout/end_of_line.rb +52 -0
- data/lib/rubocop/cop/{style → layout}/extra_spacing.rb +63 -53
- data/lib/rubocop/cop/{style → layout}/first_array_element_line_break.rb +5 -2
- data/lib/rubocop/cop/{style → layout}/first_hash_element_line_break.rb +5 -2
- data/lib/rubocop/cop/{style → layout}/first_method_argument_line_break.rb +7 -4
- data/lib/rubocop/cop/{style → layout}/first_method_parameter_line_break.rb +8 -5
- data/lib/rubocop/cop/{style → layout}/first_parameter_indentation.rb +32 -26
- data/lib/rubocop/cop/{style → layout}/indent_array.rb +75 -25
- data/lib/rubocop/cop/{style → layout}/indent_assignment.rb +9 -6
- data/lib/rubocop/cop/{style → layout}/indent_hash.rb +80 -31
- data/lib/rubocop/cop/layout/indent_heredoc.rb +208 -0
- data/lib/rubocop/cop/{style → layout}/indentation_consistency.rb +7 -5
- data/lib/rubocop/cop/{style → layout}/indentation_width.rb +151 -117
- data/lib/rubocop/cop/layout/initial_indentation.rb +45 -0
- data/lib/rubocop/cop/layout/leading_comment_space.rb +58 -0
- data/lib/rubocop/cop/{style → layout}/multiline_array_brace_layout.rb +52 -16
- data/lib/rubocop/cop/{style → layout}/multiline_assignment_layout.rb +18 -21
- data/lib/rubocop/cop/{style → layout}/multiline_block_layout.rb +37 -43
- data/lib/rubocop/cop/{style → layout}/multiline_hash_brace_layout.rb +55 -15
- data/lib/rubocop/cop/{style → layout}/multiline_method_call_brace_layout.rb +15 -4
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +221 -0
- data/lib/rubocop/cop/{style → layout}/multiline_method_definition_brace_layout.rb +12 -5
- data/lib/rubocop/cop/{style → layout}/multiline_operation_indentation.rb +23 -13
- data/lib/rubocop/cop/{style → layout}/rescue_ensure_alignment.rb +24 -13
- data/lib/rubocop/cop/{style → layout}/space_after_colon.rb +17 -13
- data/lib/rubocop/cop/layout/space_after_comma.rb +35 -0
- data/lib/rubocop/cop/{style → layout}/space_after_method_name.rb +11 -11
- data/lib/rubocop/cop/layout/space_after_not.rb +38 -0
- data/lib/rubocop/cop/{style → layout}/space_after_semicolon.rb +14 -4
- data/lib/rubocop/cop/{style → layout}/space_around_block_parameters.rb +52 -28
- data/lib/rubocop/cop/{style → layout}/space_around_equals_in_parameter_default.rb +29 -21
- data/lib/rubocop/cop/{style → layout}/space_around_keyword.rb +33 -29
- data/lib/rubocop/cop/layout/space_around_operators.rb +159 -0
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +107 -0
- data/lib/rubocop/cop/layout/space_before_comma.rb +31 -0
- data/lib/rubocop/cop/{style → layout}/space_before_comment.rb +11 -7
- data/lib/rubocop/cop/{style → layout}/space_before_first_arg.rb +23 -20
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +27 -0
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +85 -0
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +236 -0
- data/lib/rubocop/cop/{style → layout}/space_inside_array_percent_literal.rb +8 -8
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +228 -0
- data/lib/rubocop/cop/{style → layout}/space_inside_hash_literal_braces.rb +91 -51
- data/lib/rubocop/cop/layout/space_inside_parens.rb +53 -0
- data/lib/rubocop/cop/{style → layout}/space_inside_percent_literal_delimiters.rb +14 -13
- data/lib/rubocop/cop/{style → layout}/space_inside_range_literal.rb +16 -17
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +90 -0
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +80 -0
- data/lib/rubocop/cop/{style → layout}/tab.rb +8 -6
- data/lib/rubocop/cop/{style → layout}/trailing_blank_lines.rb +14 -15
- data/lib/rubocop/cop/{style → layout}/trailing_whitespace.rb +3 -4
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +59 -0
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +13 -9
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +7 -1
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +55 -25
- data/lib/rubocop/cop/lint/block_alignment.rb +75 -34
- data/lib/rubocop/cop/lint/boolean_symbol.rb +38 -0
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +17 -15
- data/lib/rubocop/cop/lint/condition_position.rb +16 -15
- data/lib/rubocop/cop/lint/debugger.rb +57 -23
- data/lib/rubocop/cop/lint/def_end_alignment.rb +28 -14
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +19 -10
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +53 -0
- data/lib/rubocop/cop/lint/duplicate_methods.rb +108 -14
- data/lib/rubocop/cop/lint/duplicated_key.rb +16 -9
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +15 -6
- data/lib/rubocop/cop/lint/else_layout.rb +27 -31
- data/lib/rubocop/cop/lint/empty_ensure.rb +44 -3
- data/lib/rubocop/cop/lint/empty_expression.rb +42 -0
- data/lib/rubocop/cop/lint/empty_interpolation.rb +16 -3
- data/lib/rubocop/cop/lint/empty_when.rb +38 -0
- data/lib/rubocop/cop/lint/end_alignment.rb +57 -39
- data/lib/rubocop/cop/lint/end_in_method.rb +24 -2
- data/lib/rubocop/cop/lint/ensure_return.rb +23 -3
- data/lib/rubocop/cop/lint/float_out_of_range.rb +10 -6
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +67 -46
- data/lib/rubocop/cop/lint/handle_exceptions.rb +41 -4
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +9 -5
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +42 -29
- data/lib/rubocop/cop/lint/inherit_exception.rb +34 -23
- data/lib/rubocop/cop/lint/interpolation_check.rb +37 -0
- data/lib/rubocop/cop/lint/{literal_in_condition.rb → literal_as_condition.rb} +51 -40
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +13 -8
- data/lib/rubocop/cop/lint/loop.rb +37 -2
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +81 -0
- data/lib/rubocop/cop/lint/multiple_compare.rb +48 -0
- data/lib/rubocop/cop/lint/nested_method_definition.rb +54 -12
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +58 -0
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +7 -3
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +32 -23
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +22 -14
- data/lib/rubocop/cop/lint/percent_string_array.rb +42 -27
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +28 -19
- data/lib/rubocop/cop/lint/rand_one.rb +17 -8
- 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 +24 -30
- data/lib/rubocop/cop/lint/rescue_exception.rb +21 -2
- data/lib/rubocop/cop/lint/rescue_type.rb +90 -0
- data/lib/rubocop/cop/lint/return_in_void_context.rb +74 -0
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +70 -0
- data/lib/rubocop/cop/lint/script_permission.rb +49 -0
- data/lib/rubocop/cop/lint/shadowed_argument.rb +146 -0
- data/lib/rubocop/cop/lint/shadowed_exception.rb +78 -57
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +25 -2
- data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +18 -12
- data/lib/rubocop/cop/lint/syntax.rb +23 -21
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +26 -4
- data/lib/rubocop/cop/lint/unified_integer.rb +43 -0
- data/lib/rubocop/cop/lint/unneeded_disable.rb +117 -56
- data/lib/rubocop/cop/lint/unneeded_require_statement.rb +51 -0
- data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +167 -0
- data/lib/rubocop/cop/lint/unreachable_code.rb +72 -8
- data/lib/rubocop/cop/lint/unused_block_argument.rb +87 -27
- data/lib/rubocop/cop/lint/unused_method_argument.rb +18 -2
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +75 -0
- data/lib/rubocop/cop/lint/uri_regexp.rb +73 -0
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +40 -18
- data/lib/rubocop/cop/lint/useless_assignment.rb +45 -14
- data/lib/rubocop/cop/lint/useless_comparison.rb +8 -10
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +16 -2
- data/lib/rubocop/cop/lint/useless_setter_call.rb +57 -43
- data/lib/rubocop/cop/lint/void.rb +83 -23
- data/lib/rubocop/cop/message_annotator.rb +118 -0
- data/lib/rubocop/cop/metrics/abc_size.rb +3 -4
- data/lib/rubocop/cop/metrics/block_length.rb +32 -0
- data/lib/rubocop/cop/metrics/block_nesting.rb +21 -10
- data/lib/rubocop/cop/metrics/class_length.rb +3 -2
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +4 -4
- data/lib/rubocop/cop/metrics/line_length.rb +67 -14
- data/lib/rubocop/cop/metrics/method_length.rb +10 -10
- data/lib/rubocop/cop/metrics/module_length.rb +3 -2
- data/lib/rubocop/cop/metrics/parameter_lists.rb +15 -6
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +5 -6
- data/lib/rubocop/cop/mixin/alignment.rb +70 -0
- data/lib/rubocop/cop/mixin/annotation_comment.rb +0 -1
- data/lib/rubocop/cop/mixin/array_hash_indentation.rb +26 -22
- data/lib/rubocop/cop/mixin/array_min_size.rb +59 -0
- data/lib/rubocop/cop/mixin/array_syntax.rb +4 -12
- data/lib/rubocop/cop/mixin/check_assignment.rb +6 -7
- data/lib/rubocop/cop/mixin/classish_length.rb +0 -1
- data/lib/rubocop/cop/mixin/code_length.rb +4 -3
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +21 -16
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +48 -0
- data/lib/rubocop/cop/mixin/configurable_max.rb +5 -4
- data/lib/rubocop/cop/mixin/configurable_naming.rb +5 -35
- data/lib/rubocop/cop/mixin/configurable_numbering.rb +17 -0
- data/lib/rubocop/cop/mixin/def_node.rb +29 -0
- data/lib/rubocop/cop/mixin/documentation_comment.rb +46 -0
- data/lib/rubocop/cop/mixin/duplication.rb +46 -0
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +119 -27
- data/lib/rubocop/cop/mixin/empty_parameter.rb +23 -0
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +11 -27
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +30 -0
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +15 -11
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +15 -13
- data/lib/rubocop/cop/mixin/hash_alignment.rb +116 -0
- data/lib/rubocop/cop/mixin/heredoc.rb +28 -0
- data/lib/rubocop/cop/mixin/ignored_pattern.rb +29 -0
- data/lib/rubocop/cop/mixin/integer_node.rb +2 -1
- data/lib/rubocop/cop/mixin/match_range.rb +4 -6
- data/lib/rubocop/cop/mixin/method_complexity.rb +33 -8
- data/lib/rubocop/cop/mixin/method_preference.rb +2 -1
- data/lib/rubocop/cop/mixin/min_body_length.rb +2 -1
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +100 -66
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +49 -51
- data/lib/rubocop/cop/mixin/negative_conditional.rb +18 -13
- data/lib/rubocop/cop/mixin/on_normal_if_unless.rb +1 -25
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +48 -0
- data/lib/rubocop/cop/mixin/parentheses.rb +2 -8
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +4 -2
- data/lib/rubocop/cop/mixin/percent_array.rb +52 -0
- data/lib/rubocop/cop/mixin/percent_literal.rb +69 -6
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +16 -5
- data/lib/rubocop/cop/mixin/rescue_node.rb +23 -0
- data/lib/rubocop/cop/mixin/safe_assignment.rb +3 -1
- data/lib/rubocop/cop/mixin/safe_mode.rb +22 -0
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +8 -10
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +10 -14
- data/lib/rubocop/cop/mixin/statement_modifier.rb +29 -32
- data/lib/rubocop/cop/mixin/string_help.rb +3 -2
- data/lib/rubocop/cop/mixin/string_literals_help.rb +3 -15
- data/lib/rubocop/cop/mixin/surrounding_space.rb +78 -9
- data/lib/rubocop/cop/mixin/target_rails_version.rb +16 -0
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +16 -0
- data/lib/rubocop/cop/mixin/too_many_lines.rb +39 -0
- data/lib/rubocop/cop/mixin/trailing_comma.rb +37 -38
- data/lib/rubocop/cop/mixin/unused_argument.rb +6 -16
- data/lib/rubocop/cop/naming/accessor_method_name.rb +55 -0
- data/lib/rubocop/cop/{style → naming}/ascii_identifiers.rb +36 -5
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +42 -0
- 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 +72 -29
- 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/naming/variable_number.rb +61 -0
- data/lib/rubocop/cop/offense.rb +9 -5
- data/lib/rubocop/cop/performance/caller.rb +69 -0
- data/lib/rubocop/cop/performance/case_when_splat.rb +65 -89
- data/lib/rubocop/cop/performance/casecmp.rb +37 -25
- data/lib/rubocop/cop/performance/compare_with_block.rb +117 -0
- data/lib/rubocop/cop/performance/count.rb +33 -43
- data/lib/rubocop/cop/performance/detect.rb +30 -31
- data/lib/rubocop/cop/performance/double_start_end_with.rb +55 -26
- data/lib/rubocop/cop/performance/end_with.rb +9 -9
- data/lib/rubocop/cop/performance/fixed_size.rb +21 -17
- data/lib/rubocop/cop/performance/flat_map.rb +30 -33
- data/lib/rubocop/cop/performance/hash_each_methods.rb +129 -0
- data/lib/rubocop/cop/performance/lstrip_rstrip.rb +14 -14
- data/lib/rubocop/cop/performance/range_include.rb +5 -4
- data/lib/rubocop/cop/performance/redundant_block_call.rb +28 -29
- data/lib/rubocop/cop/performance/redundant_match.rb +19 -15
- data/lib/rubocop/cop/performance/redundant_merge.rb +100 -52
- data/lib/rubocop/cop/performance/redundant_sort_by.rb +17 -14
- data/lib/rubocop/cop/performance/regexp_match.rb +224 -0
- data/lib/rubocop/cop/performance/reverse_each.rb +3 -6
- data/lib/rubocop/cop/performance/sample.rb +84 -83
- data/lib/rubocop/cop/performance/size.rb +22 -15
- data/lib/rubocop/cop/performance/start_with.rb +9 -9
- data/lib/rubocop/cop/performance/string_replacement.rb +35 -70
- data/lib/rubocop/cop/performance/times_map.rb +33 -24
- 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 +67 -47
- data/lib/rubocop/cop/rails/active_support_aliases.rb +68 -0
- data/lib/rubocop/cop/rails/application_job.rb +40 -0
- data/lib/rubocop/cop/rails/application_record.rb +40 -0
- data/lib/rubocop/cop/rails/blank.rb +142 -0
- data/lib/rubocop/cop/rails/create_table_with_timestamps.rb +82 -0
- data/lib/rubocop/cop/rails/date.rb +47 -42
- data/lib/rubocop/cop/rails/delegate.rb +55 -33
- data/lib/rubocop/cop/rails/delegate_allow_blank.rb +51 -0
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +82 -0
- data/lib/rubocop/cop/rails/enum_uniqueness.rb +45 -0
- data/lib/rubocop/cop/rails/environment_comparison.rb +66 -0
- data/lib/rubocop/cop/rails/exit.rb +17 -11
- data/lib/rubocop/cop/rails/file_path.rb +72 -0
- data/lib/rubocop/cop/rails/find_by.rb +14 -20
- data/lib/rubocop/cop/rails/find_each.rb +8 -21
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +9 -2
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +84 -0
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +102 -0
- data/lib/rubocop/cop/rails/inverse_of.rb +218 -0
- data/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb +112 -0
- data/lib/rubocop/cop/rails/not_null_column.rb +67 -0
- data/lib/rubocop/cop/rails/output.rb +15 -13
- data/lib/rubocop/cop/rails/output_safety.rb +65 -17
- data/lib/rubocop/cop/rails/pluralization_grammar.rb +30 -29
- data/lib/rubocop/cop/rails/presence.rb +118 -0
- data/lib/rubocop/cop/rails/present.rb +143 -0
- data/lib/rubocop/cop/rails/read_write_attribute.rb +20 -26
- data/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +133 -0
- data/lib/rubocop/cop/rails/relative_date_constant.rb +88 -0
- data/lib/rubocop/cop/rails/request_referer.rb +28 -13
- data/lib/rubocop/cop/rails/reversible_migration.rb +281 -0
- data/lib/rubocop/cop/rails/safe_navigation.rb +90 -0
- data/lib/rubocop/cop/rails/save_bang.rb +104 -19
- data/lib/rubocop/cop/rails/scope_args.rb +5 -10
- data/lib/rubocop/cop/rails/skips_model_validations.rb +70 -0
- data/lib/rubocop/cop/rails/time_zone.rb +34 -21
- data/lib/rubocop/cop/rails/uniq_before_pluck.rb +17 -14
- data/lib/rubocop/cop/rails/unknown_env.rb +63 -0
- data/lib/rubocop/cop/rails/validation.rb +16 -20
- data/lib/rubocop/cop/registry.rb +172 -0
- data/lib/rubocop/cop/security/eval.rb +30 -0
- data/lib/rubocop/cop/security/json_load.rb +46 -0
- data/lib/rubocop/cop/security/marshal_load.rb +39 -0
- data/lib/rubocop/cop/security/yaml_load.rb +37 -0
- data/lib/rubocop/cop/severity.rb +1 -2
- data/lib/rubocop/cop/style/alias.rb +54 -33
- data/lib/rubocop/cop/style/and_or.rb +77 -63
- data/lib/rubocop/cop/style/array_join.rb +13 -9
- data/lib/rubocop/cop/style/ascii_comments.rb +25 -7
- data/lib/rubocop/cop/style/attr.rb +24 -11
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +21 -16
- data/lib/rubocop/cop/style/bare_percent_literals.rb +31 -11
- data/lib/rubocop/cop/style/begin_block.rb +1 -2
- data/lib/rubocop/cop/style/block_comments.rb +20 -11
- data/lib/rubocop/cop/style/block_delimiters.rb +122 -51
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +142 -54
- data/lib/rubocop/cop/style/case_equality.rb +15 -4
- data/lib/rubocop/cop/style/character_literal.rb +12 -5
- data/lib/rubocop/cop/style/class_and_module_children.rb +85 -6
- data/lib/rubocop/cop/style/class_check.rb +35 -19
- data/lib/rubocop/cop/style/class_methods.rb +13 -14
- data/lib/rubocop/cop/style/class_vars.rb +5 -5
- data/lib/rubocop/cop/style/collection_methods.rb +12 -13
- data/lib/rubocop/cop/style/colon_method_call.rb +24 -16
- data/lib/rubocop/cop/style/colon_method_definition.rb +36 -0
- data/lib/rubocop/cop/style/command_literal.rb +98 -32
- data/lib/rubocop/cop/style/comment_annotation.rb +41 -15
- data/lib/rubocop/cop/style/commented_keyword.rb +84 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +161 -112
- data/lib/rubocop/cop/style/copyright.rb +32 -34
- data/lib/rubocop/cop/style/date_time.rb +44 -0
- data/lib/rubocop/cop/style/def_with_parentheses.rb +32 -9
- data/lib/rubocop/cop/style/dir.rb +48 -0
- data/lib/rubocop/cop/style/documentation.rb +44 -58
- data/lib/rubocop/cop/style/documentation_method.rb +76 -0
- data/lib/rubocop/cop/style/double_negation.rb +3 -3
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +14 -13
- data/lib/rubocop/cop/style/each_with_object.rb +28 -25
- data/lib/rubocop/cop/style/empty_block_parameter.rb +47 -0
- data/lib/rubocop/cop/style/empty_case_condition.rb +18 -30
- data/lib/rubocop/cop/style/empty_else.rb +82 -51
- data/lib/rubocop/cop/style/empty_lambda_parameter.rb +43 -0
- data/lib/rubocop/cop/style/empty_literal.rb +76 -48
- data/lib/rubocop/cop/style/empty_method.rb +112 -0
- data/lib/rubocop/cop/style/encoding.rb +10 -40
- data/lib/rubocop/cop/style/end_block.rb +1 -2
- data/lib/rubocop/cop/style/eval_with_location.rb +146 -0
- data/lib/rubocop/cop/style/even_odd.rb +25 -44
- data/lib/rubocop/cop/style/flip_flop.rb +13 -3
- data/lib/rubocop/cop/style/for.rb +19 -15
- data/lib/rubocop/cop/style/format_string.rb +88 -42
- data/lib/rubocop/cop/style/format_string_token.rb +163 -0
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +90 -15
- data/lib/rubocop/cop/style/global_vars.rb +14 -5
- data/lib/rubocop/cop/style/guard_clause.rb +22 -62
- data/lib/rubocop/cop/style/hash_syntax.rb +109 -59
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +73 -32
- data/lib/rubocop/cop/style/if_inside_else.rb +16 -20
- data/lib/rubocop/cop/style/if_unless_modifier.rb +48 -39
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +6 -12
- data/lib/rubocop/cop/style/if_with_semicolon.rb +10 -2
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +7 -7
- data/lib/rubocop/cop/style/infinite_loop.rb +33 -32
- data/lib/rubocop/cop/style/inline_comment.rb +17 -5
- data/lib/rubocop/cop/style/inverse_methods.rb +149 -0
- data/lib/rubocop/cop/style/lambda.rb +66 -63
- data/lib/rubocop/cop/style/lambda_call.rb +50 -20
- data/lib/rubocop/cop/style/line_end_concatenation.rb +38 -17
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +90 -0
- data/lib/rubocop/cop/style/{method_call_parentheses.rb → method_call_without_args_parentheses.rb} +32 -25
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +9 -9
- data/lib/rubocop/cop/style/method_def_parentheses.rb +101 -29
- data/lib/rubocop/cop/style/method_missing.rb +14 -20
- data/lib/rubocop/cop/style/min_max.rb +68 -0
- data/lib/rubocop/cop/style/missing_else.rb +61 -21
- data/lib/rubocop/cop/style/mixin_grouping.rb +145 -0
- data/lib/rubocop/cop/style/mixin_usage.rb +82 -0
- data/lib/rubocop/cop/style/module_function.rb +44 -18
- data/lib/rubocop/cop/style/multiline_block_chain.rb +8 -15
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +67 -0
- data/lib/rubocop/cop/style/multiline_if_then.rb +21 -14
- data/lib/rubocop/cop/style/multiline_memoization.rb +93 -0
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +21 -9
- data/lib/rubocop/cop/style/multiple_comparison.rb +77 -0
- data/lib/rubocop/cop/style/mutable_constant.rb +17 -9
- data/lib/rubocop/cop/style/negated_if.rb +76 -25
- data/lib/rubocop/cop/style/negated_while.rb +4 -22
- data/lib/rubocop/cop/style/nested_modifier.rb +17 -47
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +32 -28
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +3 -6
- data/lib/rubocop/cop/style/next.rb +72 -53
- data/lib/rubocop/cop/style/nil_comparison.rb +10 -14
- data/lib/rubocop/cop/style/non_nil_check.rb +69 -62
- data/lib/rubocop/cop/style/not.rb +19 -13
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +16 -7
- data/lib/rubocop/cop/style/numeric_literals.rb +33 -12
- data/lib/rubocop/cop/style/numeric_predicate.rb +30 -32
- data/lib/rubocop/cop/style/one_line_conditional.rb +21 -17
- data/lib/rubocop/cop/style/option_hash.rb +11 -37
- data/lib/rubocop/cop/style/optional_arguments.rb +20 -9
- data/lib/rubocop/cop/style/or_assignment.rb +88 -0
- data/lib/rubocop/cop/style/parallel_assignment.rb +83 -64
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +37 -19
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +50 -15
- data/lib/rubocop/cop/style/percent_q_literals.rb +40 -17
- data/lib/rubocop/cop/style/perl_backrefs.rb +9 -3
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +48 -14
- data/lib/rubocop/cop/style/proc.rb +13 -10
- data/lib/rubocop/cop/style/raise_args.rb +46 -50
- data/lib/rubocop/cop/style/random_with_offset.rb +160 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +16 -6
- data/lib/rubocop/cop/style/redundant_conditional.rb +96 -0
- data/lib/rubocop/cop/style/redundant_exception.rb +4 -5
- data/lib/rubocop/cop/style/redundant_freeze.rb +7 -10
- data/lib/rubocop/cop/style/redundant_parentheses.rb +70 -31
- data/lib/rubocop/cop/style/redundant_return.rb +61 -23
- data/lib/rubocop/cop/style/redundant_self.rb +62 -60
- data/lib/rubocop/cop/style/regexp_literal.rb +100 -34
- data/lib/rubocop/cop/style/rescue_modifier.rb +15 -17
- 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 +197 -0
- data/lib/rubocop/cop/style/self_assignment.rb +20 -17
- data/lib/rubocop/cop/style/semicolon.rb +25 -17
- data/lib/rubocop/cop/style/send.rb +14 -4
- data/lib/rubocop/cop/style/signal_exception.rb +105 -7
- data/lib/rubocop/cop/style/single_line_block_params.rb +27 -21
- data/lib/rubocop/cop/style/single_line_methods.rb +45 -31
- data/lib/rubocop/cop/style/special_global_vars.rb +32 -28
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +24 -53
- 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 +31 -5
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +20 -2
- data/lib/rubocop/cop/style/string_methods.rb +22 -9
- data/lib/rubocop/cop/style/struct_inheritance.rb +5 -17
- data/lib/rubocop/cop/style/symbol_array.rb +39 -65
- data/lib/rubocop/cop/style/symbol_literal.rb +1 -2
- data/lib/rubocop/cop/style/symbol_proc.rb +35 -52
- data/lib/rubocop/cop/style/ternary_parentheses.rb +143 -42
- data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +101 -0
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +31 -20
- data/lib/rubocop/cop/style/trailing_comma_in_literal.rb +26 -8
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +95 -0
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +97 -37
- data/lib/rubocop/cop/style/trivial_accessors.rb +72 -66
- data/lib/rubocop/cop/style/unless_else.rb +19 -13
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +24 -10
- data/lib/rubocop/cop/style/unneeded_interpolation.rb +22 -24
- data/lib/rubocop/cop/style/unneeded_percent_q.rb +28 -22
- data/lib/rubocop/cop/style/variable_interpolation.rb +23 -10
- data/lib/rubocop/cop/style/when_then.rb +18 -4
- data/lib/rubocop/cop/style/while_until_do.rb +34 -16
- data/lib/rubocop/cop/style/while_until_modifier.rb +32 -12
- data/lib/rubocop/cop/style/word_array.rb +45 -102
- data/lib/rubocop/cop/style/yoda_condition.rb +107 -0
- data/lib/rubocop/cop/style/zero_length_predicate.rb +55 -32
- data/lib/rubocop/cop/team.rb +33 -35
- data/lib/rubocop/cop/util.rb +120 -54
- data/lib/rubocop/cop/variable_force/assignment.rb +5 -9
- data/lib/rubocop/cop/variable_force/branch.rb +318 -0
- data/lib/rubocop/cop/variable_force/branchable.rb +21 -0
- data/lib/rubocop/cop/variable_force/reference.rb +1 -2
- data/lib/rubocop/cop/variable_force/scope.rb +37 -26
- data/lib/rubocop/cop/variable_force/variable.rb +12 -12
- data/lib/rubocop/cop/variable_force/variable_table.rb +3 -4
- data/lib/rubocop/cop/variable_force.rb +72 -39
- data/lib/rubocop/error.rb +0 -1
- data/lib/rubocop/formatter/base_formatter.rb +4 -9
- data/lib/rubocop/formatter/clang_style_formatter.rb +2 -3
- data/lib/rubocop/formatter/colorizable.rb +9 -10
- data/lib/rubocop/formatter/disabled_config_formatter.rb +48 -35
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -1
- data/lib/rubocop/formatter/emacs_style_formatter.rb +0 -1
- data/lib/rubocop/formatter/file_list_formatter.rb +0 -1
- data/lib/rubocop/formatter/formatter_set.rb +16 -13
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +6 -1
- data/lib/rubocop/formatter/html_formatter.rb +5 -5
- data/lib/rubocop/formatter/json_formatter.rb +9 -4
- data/lib/rubocop/formatter/offense_count_formatter.rb +2 -1
- data/lib/rubocop/formatter/progress_formatter.rb +0 -1
- data/lib/rubocop/formatter/quiet_formatter.rb +13 -0
- data/lib/rubocop/formatter/simple_text_formatter.rb +7 -17
- data/lib/rubocop/formatter/tap_formatter.rb +71 -0
- data/lib/rubocop/formatter/text_util.rb +0 -1
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +6 -5
- data/lib/rubocop/magic_comment.rb +210 -0
- data/lib/rubocop/name_similarity.rb +0 -1
- data/lib/rubocop/node_pattern.rb +181 -118
- data/lib/rubocop/options.rb +154 -88
- data/lib/rubocop/path_util.rb +38 -4
- data/lib/rubocop/platform.rb +11 -0
- data/lib/rubocop/processed_source.rb +23 -20
- data/lib/rubocop/rake_task.rb +16 -24
- data/lib/rubocop/remote_config.rb +40 -13
- data/lib/rubocop/result_cache.rb +33 -24
- data/lib/rubocop/rspec/cop_helper.rb +21 -7
- data/lib/rubocop/rspec/expect_offense.rb +165 -0
- data/lib/rubocop/rspec/host_environment_simulation_helper.rb +1 -2
- data/lib/rubocop/rspec/shared_contexts.rb +24 -9
- data/lib/rubocop/rspec/shared_examples.rb +10 -19
- data/lib/rubocop/rspec/support.rb +5 -5
- data/lib/rubocop/runner.rb +74 -39
- data/lib/rubocop/string_interpreter.rb +0 -1
- data/lib/rubocop/string_util.rb +11 -6
- data/lib/rubocop/target_finder.rb +70 -8
- data/lib/rubocop/token.rb +79 -2
- data/lib/rubocop/version.rb +2 -5
- data/lib/rubocop/warning.rb +0 -1
- data/lib/rubocop.rb +569 -398
- metadata +301 -112
- data/lib/rubocop/ast_node/builder.rb +0 -31
- data/lib/rubocop/ast_node/sexp.rb +0 -14
- data/lib/rubocop/ast_node.rb +0 -623
- data/lib/rubocop/cop/lint/eval.rb +0 -23
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +0 -39
- data/lib/rubocop/cop/lint/useless_array_splat.rb +0 -56
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +0 -42
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +0 -152
- data/lib/rubocop/cop/mixin/hash_node.rb +0 -15
- data/lib/rubocop/cop/mixin/if_node.rb +0 -37
- data/lib/rubocop/cop/mixin/on_method_def.rb +0 -31
- data/lib/rubocop/cop/mixin/space_inside.rb +0 -79
- data/lib/rubocop/cop/performance/hash_each.rb +0 -86
- data/lib/rubocop/cop/performance/push_splat.rb +0 -47
- data/lib/rubocop/cop/style/accessor_method_name.rb +0 -46
- data/lib/rubocop/cop/style/align_array.rb +0 -21
- data/lib/rubocop/cop/style/align_hash.rb +0 -256
- data/lib/rubocop/cop/style/case_indentation.rb +0 -92
- data/lib/rubocop/cop/style/class_and_module_camel_case.rb +0 -30
- data/lib/rubocop/cop/style/constant_name.rb +0 -30
- data/lib/rubocop/cop/style/empty_line_between_defs.rb +0 -76
- data/lib/rubocop/cop/style/empty_lines_around_class_body.rb +0 -40
- data/lib/rubocop/cop/style/end_of_line.rb +0 -31
- data/lib/rubocop/cop/style/initial_indentation.rb +0 -38
- data/lib/rubocop/cop/style/leading_comment_space.rb +0 -33
- data/lib/rubocop/cop/style/method_name.rb +0 -29
- data/lib/rubocop/cop/style/multiline_method_call_indentation.rb +0 -176
- data/lib/rubocop/cop/style/op_method.rb +0 -44
- data/lib/rubocop/cop/style/predicate_name.rb +0 -68
- data/lib/rubocop/cop/style/space_after_comma.rb +0 -22
- data/lib/rubocop/cop/style/space_after_not.rb +0 -42
- data/lib/rubocop/cop/style/space_around_operators.rb +0 -132
- data/lib/rubocop/cop/style/space_before_block_braces.rb +0 -65
- data/lib/rubocop/cop/style/space_before_comma.rb +0 -17
- data/lib/rubocop/cop/style/space_before_semicolon.rb +0 -17
- data/lib/rubocop/cop/style/space_inside_block_braces.rb +0 -166
- data/lib/rubocop/cop/style/space_inside_brackets.rb +0 -21
- data/lib/rubocop/cop/style/space_inside_parens.rb +0 -17
- data/lib/rubocop/cop/style/space_inside_string_interpolation.rb +0 -52
- data/lib/rubocop/cop/style/variable_name.rb +0 -40
- data/lib/rubocop/cop/variable_force/locatable.rb +0 -197
data/config/enabled.yml
CHANGED
@@ -1,1471 +1,1989 @@
|
|
1
1
|
# These are all the cops that are enabled in the default configuration.
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
#################### Bundler ###############################
|
4
|
+
|
5
|
+
Bundler/DuplicatedGem:
|
6
|
+
Description: 'Checks for duplicate gem entries in Gemfile.'
|
6
7
|
Enabled: true
|
8
|
+
Include:
|
9
|
+
- '**/Gemfile'
|
10
|
+
- '**/gems.rb'
|
7
11
|
|
8
|
-
|
9
|
-
Description:
|
10
|
-
|
12
|
+
Bundler/InsecureProtocolSource:
|
13
|
+
Description: >-
|
14
|
+
The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
|
15
|
+
because HTTP requests are insecure. Please change your source to
|
16
|
+
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
11
17
|
Enabled: true
|
18
|
+
Include:
|
19
|
+
- '**/Gemfile'
|
20
|
+
- '**/gems.rb'
|
12
21
|
|
13
|
-
|
14
|
-
Description:
|
15
|
-
|
22
|
+
Bundler/OrderedGems:
|
23
|
+
Description: >-
|
24
|
+
Gems within groups in the Gemfile should be alphabetically sorted.
|
25
|
+
Enabled: true
|
26
|
+
Include:
|
27
|
+
- '**/Gemfile'
|
28
|
+
- '**/gems.rb'
|
29
|
+
|
30
|
+
#################### Gemspec ###############################
|
31
|
+
|
32
|
+
Gemspec/DuplicatedAssignment:
|
33
|
+
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
34
|
+
Enabled: true
|
35
|
+
Include:
|
36
|
+
- '**/*.gemspec'
|
37
|
+
|
38
|
+
Gemspec/OrderedDependencies:
|
39
|
+
Description: >-
|
40
|
+
Dependencies in the gemspec should be alphabetically sorted.
|
41
|
+
Enabled: true
|
42
|
+
Include:
|
43
|
+
- '**/*.gemspec'
|
44
|
+
|
45
|
+
Gemspec/RequiredRubyVersion:
|
46
|
+
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
|
47
|
+
Enabled: true
|
48
|
+
Include:
|
49
|
+
- '**/*.gemspec'
|
50
|
+
|
51
|
+
#################### Layout ###############################
|
52
|
+
|
53
|
+
Layout/AccessModifierIndentation:
|
54
|
+
Description: Check indentation of private/protected visibility modifiers.
|
55
|
+
StyleGuide: '#indent-public-private-protected'
|
16
56
|
Enabled: true
|
17
57
|
|
18
|
-
|
58
|
+
Layout/AlignArray:
|
19
59
|
Description: >-
|
20
60
|
Align the elements of an array literal if they span more than
|
21
61
|
one line.
|
22
|
-
StyleGuide: '
|
62
|
+
StyleGuide: '#align-multiline-arrays'
|
23
63
|
Enabled: true
|
24
64
|
|
25
|
-
|
65
|
+
Layout/AlignHash:
|
26
66
|
Description: >-
|
27
67
|
Align the elements of a hash literal if they span more than
|
28
68
|
one line.
|
29
69
|
Enabled: true
|
30
70
|
|
31
|
-
|
71
|
+
Layout/AlignParameters:
|
32
72
|
Description: >-
|
33
73
|
Align the parameters of a method call if they span more
|
34
74
|
than one line.
|
35
|
-
StyleGuide: '
|
36
|
-
Enabled: true
|
37
|
-
|
38
|
-
Style/AndOr:
|
39
|
-
Description: 'Use &&/|| instead of and/or.'
|
40
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
|
75
|
+
StyleGuide: '#no-double-indent'
|
41
76
|
Enabled: true
|
42
77
|
|
43
|
-
|
44
|
-
Description: '
|
45
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
78
|
+
Layout/BlockEndNewline:
|
79
|
+
Description: 'Put end statement of multiline block on its own line.'
|
46
80
|
Enabled: true
|
47
81
|
|
48
|
-
|
49
|
-
Description: '
|
50
|
-
StyleGuide: '
|
82
|
+
Layout/CaseIndentation:
|
83
|
+
Description: 'Indentation of when in a case/when/[else/]end.'
|
84
|
+
StyleGuide: '#indent-when-to-case'
|
51
85
|
Enabled: true
|
52
86
|
|
53
|
-
|
54
|
-
Description: '
|
55
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
87
|
+
Layout/ClosingParenthesisIndentation:
|
88
|
+
Description: 'Checks the indentation of hanging closing parentheses.'
|
56
89
|
Enabled: true
|
57
90
|
|
58
|
-
|
59
|
-
Description: '
|
60
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
91
|
+
Layout/CommentIndentation:
|
92
|
+
Description: 'Indentation of comments.'
|
61
93
|
Enabled: true
|
62
94
|
|
63
|
-
|
64
|
-
Description: '
|
65
|
-
StyleGuide: '
|
95
|
+
Layout/DotPosition:
|
96
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
97
|
+
StyleGuide: '#consistent-multi-line-chains'
|
66
98
|
Enabled: true
|
67
99
|
|
68
|
-
|
69
|
-
Description: '
|
70
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
|
100
|
+
Layout/ElseAlignment:
|
101
|
+
Description: 'Align elses and elsifs correctly.'
|
71
102
|
Enabled: true
|
72
103
|
|
73
|
-
|
74
|
-
Description: '
|
75
|
-
StyleGuide: '
|
104
|
+
Layout/EmptyLineAfterMagicComment:
|
105
|
+
Description: 'Add an empty line after magic comments to separate them from code.'
|
106
|
+
StyleGuide: '#separate-magic-comments-from-code'
|
76
107
|
Enabled: true
|
77
108
|
|
78
|
-
|
79
|
-
Description: '
|
109
|
+
Layout/EmptyLineBetweenDefs:
|
110
|
+
Description: 'Use empty lines between defs.'
|
111
|
+
StyleGuide: '#empty-lines-between-methods'
|
80
112
|
Enabled: true
|
81
113
|
|
82
|
-
|
83
|
-
Description:
|
84
|
-
|
85
|
-
always ugly).
|
86
|
-
Prefer {...} over do...end for single-line blocks.
|
87
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
114
|
+
Layout/EmptyLines:
|
115
|
+
Description: "Don't use several empty lines in a row."
|
116
|
+
StyleGuide: '#two-or-more-empty-lines'
|
88
117
|
Enabled: true
|
89
118
|
|
90
|
-
|
91
|
-
Description:
|
119
|
+
Layout/EmptyLinesAroundAccessModifier:
|
120
|
+
Description: "Keep blank lines around access modifiers."
|
121
|
+
StyleGuide: '#empty-lines-around-access-modifier'
|
92
122
|
Enabled: true
|
93
123
|
|
94
|
-
|
95
|
-
Description:
|
96
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
124
|
+
Layout/EmptyLinesAroundArguments:
|
125
|
+
Description: "Keeps track of empty lines around method arguments."
|
97
126
|
Enabled: true
|
98
127
|
|
99
|
-
|
100
|
-
Description:
|
101
|
-
StyleGuide: '
|
128
|
+
Layout/EmptyLinesAroundBeginBody:
|
129
|
+
Description: "Keeps track of empty lines around begin-end bodies."
|
130
|
+
StyleGuide: '#empty-lines-around-bodies'
|
102
131
|
Enabled: true
|
103
132
|
|
104
|
-
|
105
|
-
Description:
|
106
|
-
StyleGuide: '
|
133
|
+
Layout/EmptyLinesAroundBlockBody:
|
134
|
+
Description: "Keeps track of empty lines around block bodies."
|
135
|
+
StyleGuide: '#empty-lines-around-bodies'
|
107
136
|
Enabled: true
|
108
137
|
|
109
|
-
|
110
|
-
Description:
|
111
|
-
StyleGuide: '
|
138
|
+
Layout/EmptyLinesAroundClassBody:
|
139
|
+
Description: "Keeps track of empty lines around class bodies."
|
140
|
+
StyleGuide: '#empty-lines-around-bodies'
|
112
141
|
Enabled: true
|
113
142
|
|
114
|
-
|
115
|
-
Description:
|
143
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
144
|
+
Description: "Keeps track of empty lines around exception handling keywords."
|
145
|
+
StyleGuide: '#empty-lines-around-bodies'
|
116
146
|
Enabled: true
|
117
147
|
|
118
|
-
|
119
|
-
Description:
|
148
|
+
Layout/EmptyLinesAroundMethodBody:
|
149
|
+
Description: "Keeps track of empty lines around method bodies."
|
150
|
+
StyleGuide: '#empty-lines-around-bodies'
|
120
151
|
Enabled: true
|
121
152
|
|
122
|
-
|
123
|
-
Description:
|
124
|
-
StyleGuide: '
|
153
|
+
Layout/EmptyLinesAroundModuleBody:
|
154
|
+
Description: "Keeps track of empty lines around module bodies."
|
155
|
+
StyleGuide: '#empty-lines-around-bodies'
|
125
156
|
Enabled: true
|
126
157
|
|
127
|
-
|
128
|
-
Description: '
|
129
|
-
StyleGuide: '
|
158
|
+
Layout/EndOfLine:
|
159
|
+
Description: 'Use Unix-style line endings.'
|
160
|
+
StyleGuide: '#crlf'
|
130
161
|
Enabled: true
|
131
162
|
|
132
|
-
|
133
|
-
Description: '
|
163
|
+
Layout/ExtraSpacing:
|
164
|
+
Description: 'Do not use unnecessary spacing.'
|
134
165
|
Enabled: true
|
135
166
|
|
136
|
-
|
137
|
-
Description: '
|
138
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
167
|
+
Layout/FirstParameterIndentation:
|
168
|
+
Description: 'Checks the indentation of the first parameter in a method call.'
|
139
169
|
Enabled: true
|
140
170
|
|
141
|
-
|
142
|
-
Description:
|
143
|
-
|
171
|
+
Layout/IndentArray:
|
172
|
+
Description: >-
|
173
|
+
Checks the indentation of the first element in an array
|
174
|
+
literal.
|
144
175
|
Enabled: true
|
145
176
|
|
146
|
-
|
177
|
+
Layout/IndentAssignment:
|
147
178
|
Description: >-
|
148
|
-
Checks
|
149
|
-
|
150
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
179
|
+
Checks the indentation of the first line of the
|
180
|
+
right-hand-side of a multi-line assignment.
|
151
181
|
Enabled: true
|
152
182
|
|
153
|
-
|
154
|
-
Description: '
|
183
|
+
Layout/IndentHash:
|
184
|
+
Description: 'Checks the indentation of the first key in a hash literal.'
|
155
185
|
Enabled: true
|
156
186
|
|
157
|
-
|
158
|
-
Description:
|
159
|
-
|
160
|
-
assignment to a variable and variable comparison instead
|
161
|
-
of assigning that variable inside of each branch.
|
187
|
+
Layout/IndentHeredoc:
|
188
|
+
Description: 'This cops checks the indentation of the here document bodies.'
|
189
|
+
StyleGuide: '#squiggly-heredocs'
|
162
190
|
Enabled: true
|
163
191
|
|
164
|
-
|
165
|
-
Description: '
|
166
|
-
StyleGuide: '
|
192
|
+
Layout/IndentationConsistency:
|
193
|
+
Description: 'Keep indentation straight.'
|
194
|
+
StyleGuide: '#spaces-indentation'
|
167
195
|
Enabled: true
|
168
196
|
|
169
|
-
|
170
|
-
Description: 'Use
|
171
|
-
StyleGuide: '
|
197
|
+
Layout/IndentationWidth:
|
198
|
+
Description: 'Use 2 spaces for indentation.'
|
199
|
+
StyleGuide: '#spaces-indentation'
|
172
200
|
Enabled: true
|
173
201
|
|
174
|
-
|
175
|
-
Description:
|
176
|
-
|
202
|
+
Layout/InitialIndentation:
|
203
|
+
Description: >-
|
204
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
177
205
|
Enabled: true
|
178
206
|
|
179
|
-
|
180
|
-
Description: '
|
207
|
+
Layout/LeadingCommentSpace:
|
208
|
+
Description: 'Comments should start with a space.'
|
209
|
+
StyleGuide: '#hash-space'
|
181
210
|
Enabled: true
|
182
|
-
Exclude:
|
183
|
-
- 'spec/**/*'
|
184
|
-
- 'test/**/*'
|
185
211
|
|
186
|
-
|
187
|
-
Description:
|
188
|
-
|
212
|
+
Layout/MultilineArrayBraceLayout:
|
213
|
+
Description: >-
|
214
|
+
Checks that the closing brace in an array literal is
|
215
|
+
either on the same line as the last array element, or
|
216
|
+
a new line.
|
189
217
|
Enabled: true
|
190
218
|
|
191
|
-
|
192
|
-
Description: '
|
193
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
219
|
+
Layout/MultilineBlockLayout:
|
220
|
+
Description: 'Ensures newlines after multiline block do statements.'
|
194
221
|
Enabled: true
|
195
222
|
|
196
|
-
|
223
|
+
Layout/MultilineHashBraceLayout:
|
197
224
|
Description: >-
|
198
|
-
|
199
|
-
|
225
|
+
Checks that the closing brace in a hash literal is
|
226
|
+
either on the same line as the last hash element, or
|
227
|
+
a new line.
|
200
228
|
Enabled: true
|
201
229
|
|
202
|
-
|
203
|
-
Description:
|
230
|
+
Layout/MultilineMethodCallBraceLayout:
|
231
|
+
Description: >-
|
232
|
+
Checks that the closing brace in a method call is
|
233
|
+
either on the same line as the last method argument, or
|
234
|
+
a new line.
|
204
235
|
Enabled: true
|
205
236
|
|
206
|
-
|
207
|
-
Description:
|
237
|
+
Layout/MultilineMethodCallIndentation:
|
238
|
+
Description: >-
|
239
|
+
Checks indentation of method calls with the dot operator
|
240
|
+
that span more than one line.
|
208
241
|
Enabled: true
|
209
242
|
|
210
|
-
|
211
|
-
Description:
|
243
|
+
Layout/MultilineMethodDefinitionBraceLayout:
|
244
|
+
Description: >-
|
245
|
+
Checks that the closing brace in a method definition is
|
246
|
+
either on the same line as the last method parameter, or
|
247
|
+
a new line.
|
212
248
|
Enabled: true
|
213
249
|
|
214
|
-
|
215
|
-
Description:
|
250
|
+
Layout/MultilineOperationIndentation:
|
251
|
+
Description: >-
|
252
|
+
Checks indentation of binary operations that span more than
|
253
|
+
one line.
|
216
254
|
Enabled: true
|
217
255
|
|
218
|
-
|
219
|
-
Description: '
|
220
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
|
256
|
+
Layout/RescueEnsureAlignment:
|
257
|
+
Description: 'Align rescues and ensures correctly.'
|
221
258
|
Enabled: true
|
222
259
|
|
223
|
-
|
224
|
-
Description:
|
260
|
+
Layout/SpaceAfterColon:
|
261
|
+
Description: 'Use spaces after colons.'
|
262
|
+
StyleGuide: '#spaces-operators'
|
225
263
|
Enabled: true
|
226
264
|
|
227
|
-
|
228
|
-
Description:
|
265
|
+
Layout/SpaceAfterComma:
|
266
|
+
Description: 'Use spaces after commas.'
|
267
|
+
StyleGuide: '#spaces-operators'
|
229
268
|
Enabled: true
|
230
269
|
|
231
|
-
|
232
|
-
Description:
|
270
|
+
Layout/SpaceAfterMethodName:
|
271
|
+
Description: >-
|
272
|
+
Do not put a space between a method name and the opening
|
273
|
+
parenthesis in a method definition.
|
274
|
+
StyleGuide: '#parens-no-spaces'
|
233
275
|
Enabled: true
|
234
276
|
|
235
|
-
|
236
|
-
Description:
|
277
|
+
Layout/SpaceAfterNot:
|
278
|
+
Description: Tracks redundant space after the ! operator.
|
279
|
+
StyleGuide: '#no-space-bang'
|
237
280
|
Enabled: true
|
238
281
|
|
239
|
-
|
240
|
-
Description:
|
282
|
+
Layout/SpaceAfterSemicolon:
|
283
|
+
Description: 'Use spaces after semicolons.'
|
284
|
+
StyleGuide: '#spaces-operators'
|
241
285
|
Enabled: true
|
242
286
|
|
243
|
-
|
244
|
-
Description:
|
287
|
+
Layout/SpaceAroundBlockParameters:
|
288
|
+
Description: 'Checks the spacing inside and after block parameters pipes.'
|
245
289
|
Enabled: true
|
246
290
|
|
247
|
-
|
248
|
-
Description:
|
249
|
-
|
291
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
292
|
+
Description: >-
|
293
|
+
Checks that the equals signs in parameter default assignments
|
294
|
+
have or don't have surrounding space depending on
|
295
|
+
configuration.
|
296
|
+
StyleGuide: '#spaces-around-equals'
|
250
297
|
Enabled: true
|
251
298
|
|
252
|
-
|
253
|
-
Description: '
|
254
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
|
299
|
+
Layout/SpaceAroundKeyword:
|
300
|
+
Description: 'Use a space around keywords if appropriate.'
|
255
301
|
Enabled: true
|
256
302
|
|
257
|
-
|
258
|
-
Description: 'Use
|
259
|
-
StyleGuide: '
|
303
|
+
Layout/SpaceAroundOperators:
|
304
|
+
Description: 'Use a single space around operators.'
|
305
|
+
StyleGuide: '#spaces-operators'
|
260
306
|
Enabled: true
|
261
307
|
|
262
|
-
|
263
|
-
Description:
|
264
|
-
|
308
|
+
Layout/SpaceBeforeBlockBraces:
|
309
|
+
Description: >-
|
310
|
+
Checks that the left block brace has or doesn't have space
|
311
|
+
before it.
|
265
312
|
Enabled: true
|
266
313
|
|
267
|
-
|
268
|
-
Description: '
|
314
|
+
Layout/SpaceBeforeComma:
|
315
|
+
Description: 'No spaces before commas.'
|
269
316
|
Enabled: true
|
270
317
|
|
271
|
-
|
272
|
-
Description:
|
273
|
-
|
318
|
+
Layout/SpaceBeforeComment:
|
319
|
+
Description: >-
|
320
|
+
Checks for missing space between code and a comment on the
|
321
|
+
same line.
|
274
322
|
Enabled: true
|
275
323
|
|
276
|
-
|
324
|
+
Layout/SpaceBeforeFirstArg:
|
277
325
|
Description: >-
|
278
|
-
|
279
|
-
|
326
|
+
Checks that exactly one space is used between a method name
|
327
|
+
and the first argument for method calls without parentheses.
|
280
328
|
Enabled: true
|
281
329
|
|
282
|
-
|
283
|
-
Description:
|
284
|
-
Checks the indentation of the first non-blank non-comment line in a file.
|
330
|
+
Layout/SpaceBeforeSemicolon:
|
331
|
+
Description: 'No spaces before semicolons.'
|
285
332
|
Enabled: true
|
286
333
|
|
287
|
-
|
288
|
-
Description: 'Checks
|
334
|
+
Layout/SpaceInLambdaLiteral:
|
335
|
+
Description: 'Checks for spaces in lambda literals.'
|
289
336
|
Enabled: true
|
290
337
|
|
291
|
-
|
292
|
-
Description: 'Checks
|
293
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
338
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
339
|
+
Description: 'Checks the spacing inside array literal brackets.'
|
294
340
|
Enabled: true
|
295
341
|
|
296
|
-
|
297
|
-
Description: '
|
298
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
|
342
|
+
Layout/SpaceInsideArrayPercentLiteral:
|
343
|
+
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
|
299
344
|
Enabled: true
|
300
345
|
|
301
|
-
|
302
|
-
Description:
|
303
|
-
|
346
|
+
Layout/SpaceInsideBlockBraces:
|
347
|
+
Description: >-
|
348
|
+
Checks that block braces have or don't have surrounding space.
|
349
|
+
For blocks taking parameters, checks that the left brace has
|
350
|
+
or doesn't have trailing space.
|
304
351
|
Enabled: true
|
305
352
|
|
306
|
-
|
307
|
-
Description:
|
308
|
-
StyleGuide: '
|
309
|
-
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
353
|
+
Layout/SpaceInsideHashLiteralBraces:
|
354
|
+
Description: "Use spaces inside hash literal braces - or don't."
|
355
|
+
StyleGuide: '#spaces-operators'
|
310
356
|
Enabled: true
|
311
357
|
|
312
|
-
|
313
|
-
Description: '
|
314
|
-
StyleGuide: '
|
358
|
+
Layout/SpaceInsideParens:
|
359
|
+
Description: 'No spaces after ( or before ).'
|
360
|
+
StyleGuide: '#spaces-braces'
|
315
361
|
Enabled: true
|
316
362
|
|
317
|
-
|
318
|
-
Description:
|
319
|
-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
320
|
-
{ :a => 1, :b => 2 }.
|
321
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
363
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
364
|
+
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
|
322
365
|
Enabled: true
|
323
366
|
|
324
|
-
|
325
|
-
Description: '
|
367
|
+
Layout/SpaceInsideRangeLiteral:
|
368
|
+
Description: 'No spaces inside range literals.'
|
369
|
+
StyleGuide: '#no-space-inside-range-literals'
|
326
370
|
Enabled: true
|
327
371
|
|
328
|
-
|
329
|
-
Description:
|
330
|
-
Favor modifier if/unless usage when you have a
|
331
|
-
single-line body.
|
332
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
372
|
+
Layout/SpaceInsideReferenceBrackets:
|
373
|
+
Description: 'Checks the spacing inside referential brackets.'
|
333
374
|
Enabled: true
|
334
375
|
|
335
|
-
|
336
|
-
Description:
|
337
|
-
|
376
|
+
Layout/SpaceInsideStringInterpolation:
|
377
|
+
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
|
378
|
+
StyleGuide: '#string-interpolation'
|
338
379
|
Enabled: true
|
339
380
|
|
340
|
-
|
341
|
-
Description: '
|
342
|
-
StyleGuide: '
|
381
|
+
Layout/Tab:
|
382
|
+
Description: 'No hard tabs.'
|
383
|
+
StyleGuide: '#spaces-indentation'
|
343
384
|
Enabled: true
|
344
385
|
|
345
|
-
|
346
|
-
Description: '
|
386
|
+
Layout/TrailingBlankLines:
|
387
|
+
Description: 'Checks trailing blank lines and final newline.'
|
388
|
+
StyleGuide: '#newline-eof'
|
347
389
|
Enabled: true
|
348
390
|
|
349
|
-
|
350
|
-
Description: '
|
351
|
-
StyleGuide: '
|
391
|
+
Layout/TrailingWhitespace:
|
392
|
+
Description: 'Avoid trailing whitespace.'
|
393
|
+
StyleGuide: '#no-trailing-whitespace'
|
352
394
|
Enabled: true
|
353
395
|
|
354
|
-
|
396
|
+
#################### Lint ##################################
|
397
|
+
### Warnings
|
398
|
+
|
399
|
+
Lint/AmbiguousBlockAssociation:
|
355
400
|
Description: >-
|
356
|
-
Checks
|
357
|
-
|
358
|
-
|
401
|
+
Checks for ambiguous block association with method when param passed without
|
402
|
+
parentheses.
|
403
|
+
StyleGuide: '#syntax'
|
359
404
|
Enabled: true
|
360
405
|
|
361
|
-
|
406
|
+
Lint/AmbiguousOperator:
|
362
407
|
Description: >-
|
363
|
-
Checks
|
364
|
-
|
408
|
+
Checks for ambiguous operators in the first argument of a
|
409
|
+
method invocation without parentheses.
|
410
|
+
StyleGuide: '#method-invocation-parens'
|
365
411
|
Enabled: true
|
366
412
|
|
367
|
-
|
413
|
+
Lint/AmbiguousRegexpLiteral:
|
368
414
|
Description: >-
|
369
|
-
Checks
|
370
|
-
|
415
|
+
Checks for ambiguous regexp literals in the first argument of
|
416
|
+
a method invocation without parentheses.
|
371
417
|
Enabled: true
|
372
418
|
|
373
|
-
|
374
|
-
Description: '
|
419
|
+
Lint/AssignmentInCondition:
|
420
|
+
Description: "Don't use assignment in conditions."
|
421
|
+
StyleGuide: '#safe-assignment-in-condition'
|
375
422
|
Enabled: true
|
376
423
|
|
377
|
-
|
378
|
-
Description: '
|
379
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
|
424
|
+
Lint/BlockAlignment:
|
425
|
+
Description: 'Align block ends correctly.'
|
380
426
|
Enabled: true
|
381
427
|
|
382
|
-
|
383
|
-
Description: '
|
384
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
428
|
+
Lint/BooleanSymbol:
|
429
|
+
Description: 'Check for `:true` and `:false` symbols.'
|
385
430
|
Enabled: true
|
386
431
|
|
387
|
-
|
388
|
-
Description:
|
389
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
432
|
+
Lint/CircularArgumentReference:
|
433
|
+
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
390
434
|
Enabled: true
|
391
435
|
|
392
|
-
|
393
|
-
Description:
|
394
|
-
|
436
|
+
Lint/ConditionPosition:
|
437
|
+
Description: >-
|
438
|
+
Checks for condition placed in a confusing position relative to
|
439
|
+
the keyword.
|
440
|
+
StyleGuide: '#same-line-condition'
|
395
441
|
Enabled: true
|
396
442
|
|
397
|
-
|
398
|
-
Description:
|
399
|
-
Use \ instead of + or << to concatenate two string literals at
|
400
|
-
line end.
|
443
|
+
Lint/Debugger:
|
444
|
+
Description: 'Check for debugger calls.'
|
401
445
|
Enabled: true
|
402
446
|
|
403
|
-
|
404
|
-
Description: '
|
405
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
447
|
+
Lint/DefEndAlignment:
|
448
|
+
Description: 'Align ends corresponding to defs correctly.'
|
406
449
|
Enabled: true
|
407
450
|
|
408
|
-
|
409
|
-
Description:
|
410
|
-
Checks if the method definitions have or don't have
|
411
|
-
parentheses.
|
412
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
451
|
+
Lint/DeprecatedClassMethods:
|
452
|
+
Description: 'Check for deprecated class method calls.'
|
413
453
|
Enabled: true
|
414
454
|
|
415
|
-
|
416
|
-
Description: '
|
417
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
455
|
+
Lint/DuplicateCaseCondition:
|
456
|
+
Description: 'Do not repeat values in case conditionals.'
|
418
457
|
Enabled: true
|
419
458
|
|
420
|
-
|
421
|
-
Description: '
|
422
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-method-missing'
|
459
|
+
Lint/DuplicateMethods:
|
460
|
+
Description: 'Check for duplicate method definitions.'
|
423
461
|
Enabled: true
|
424
462
|
|
425
|
-
|
426
|
-
Description: '
|
427
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
463
|
+
Lint/DuplicatedKey:
|
464
|
+
Description: 'Check for duplicate keys in hash literals.'
|
428
465
|
Enabled: true
|
429
466
|
|
430
|
-
|
431
|
-
Description:
|
432
|
-
Checks that the closing brace in an array literal is
|
433
|
-
either on the same line as the last array element, or
|
434
|
-
a new line.
|
467
|
+
Lint/EachWithObjectArgument:
|
468
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
435
469
|
Enabled: true
|
436
470
|
|
437
|
-
|
438
|
-
Description: '
|
439
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
471
|
+
Lint/ElseLayout:
|
472
|
+
Description: 'Check for odd code arrangement in an else block.'
|
440
473
|
Enabled: true
|
441
474
|
|
442
|
-
|
443
|
-
Description: '
|
475
|
+
Lint/EmptyEnsure:
|
476
|
+
Description: 'Checks for empty ensure block.'
|
444
477
|
Enabled: true
|
478
|
+
AutoCorrect: false
|
445
479
|
|
446
|
-
|
447
|
-
Description:
|
448
|
-
Checks that the closing brace in a hash literal is
|
449
|
-
either on the same line as the last hash element, or
|
450
|
-
a new line.
|
480
|
+
Lint/EmptyExpression:
|
481
|
+
Description: 'Checks for empty expressions.'
|
451
482
|
Enabled: true
|
452
483
|
|
453
|
-
|
454
|
-
Description: '
|
455
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
|
484
|
+
Lint/EmptyInterpolation:
|
485
|
+
Description: 'Checks for empty string interpolation.'
|
456
486
|
Enabled: true
|
457
487
|
|
458
|
-
|
459
|
-
Description:
|
460
|
-
Checks that the closing brace in a method call is
|
461
|
-
either on the same line as the last method argument, or
|
462
|
-
a new line.
|
488
|
+
Lint/EmptyWhen:
|
489
|
+
Description: 'Checks for `when` branches with empty bodies.'
|
463
490
|
Enabled: true
|
464
491
|
|
465
|
-
|
466
|
-
Description:
|
467
|
-
Checks indentation of method calls with the dot operator
|
468
|
-
that span more than one line.
|
492
|
+
Lint/EndAlignment:
|
493
|
+
Description: 'Align ends correctly.'
|
469
494
|
Enabled: true
|
470
495
|
|
471
|
-
|
472
|
-
Description:
|
473
|
-
Checks that the closing brace in a method definition is
|
474
|
-
either on the same line as the last method parameter, or
|
475
|
-
a new line.
|
496
|
+
Lint/EndInMethod:
|
497
|
+
Description: 'END blocks should not be placed inside method definitions.'
|
476
498
|
Enabled: true
|
477
499
|
|
478
|
-
|
479
|
-
Description:
|
480
|
-
|
481
|
-
one line.
|
500
|
+
Lint/EnsureReturn:
|
501
|
+
Description: 'Do not use return in an ensure block.'
|
502
|
+
StyleGuide: '#no-return-ensure'
|
482
503
|
Enabled: true
|
483
504
|
|
484
|
-
|
505
|
+
Lint/FloatOutOfRange:
|
485
506
|
Description: >-
|
486
|
-
|
487
|
-
|
488
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
|
507
|
+
Catches floating-point literals too large or small for Ruby to
|
508
|
+
represent.
|
489
509
|
Enabled: true
|
490
510
|
|
491
|
-
|
492
|
-
Description: '
|
511
|
+
Lint/FormatParameterMismatch:
|
512
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
493
513
|
Enabled: true
|
494
514
|
|
495
|
-
|
496
|
-
Description:
|
497
|
-
|
498
|
-
(or control flow or).
|
499
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
515
|
+
Lint/HandleExceptions:
|
516
|
+
Description: "Don't suppress exception."
|
517
|
+
StyleGuide: '#dont-hide-exceptions'
|
500
518
|
Enabled: true
|
501
519
|
|
502
|
-
|
503
|
-
Description:
|
504
|
-
|
520
|
+
Lint/ImplicitStringConcatenation:
|
521
|
+
Description: >-
|
522
|
+
Checks for adjacent string literals on the same line, which
|
523
|
+
could better be represented as a single string literal.
|
505
524
|
Enabled: true
|
506
525
|
|
507
|
-
|
508
|
-
Description:
|
509
|
-
|
526
|
+
Lint/IneffectiveAccessModifier:
|
527
|
+
Description: >-
|
528
|
+
Checks for attempts to use `private` or `protected` to set
|
529
|
+
the visibility of a class method, which does not work.
|
510
530
|
Enabled: true
|
511
531
|
|
512
|
-
|
513
|
-
Description:
|
514
|
-
Parenthesize method calls which are nested inside the
|
515
|
-
argument list of another parenthesized method call.
|
532
|
+
Lint/InheritException:
|
533
|
+
Description: 'Avoid inheriting from the `Exception` class.'
|
516
534
|
Enabled: true
|
517
535
|
|
518
|
-
|
519
|
-
Description: '
|
520
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
|
536
|
+
Lint/InterpolationCheck:
|
537
|
+
Description: 'Raise warning for interpolation in single q strs'
|
521
538
|
Enabled: true
|
522
539
|
|
523
|
-
|
524
|
-
Description: '
|
525
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
540
|
+
Lint/LiteralAsCondition:
|
541
|
+
Description: 'Checks of literals used in conditions.'
|
526
542
|
Enabled: true
|
527
543
|
|
528
|
-
|
529
|
-
Description: '
|
530
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
544
|
+
Lint/LiteralInInterpolation:
|
545
|
+
Description: 'Checks for literals used in interpolation.'
|
531
546
|
Enabled: true
|
532
547
|
|
533
|
-
|
534
|
-
Description:
|
535
|
-
|
548
|
+
Lint/Loop:
|
549
|
+
Description: >-
|
550
|
+
Use Kernel#loop with break rather than begin/end/until or
|
551
|
+
begin/end/while for post-loop tests.
|
552
|
+
StyleGuide: '#loop-with-break'
|
536
553
|
Enabled: true
|
537
554
|
|
538
|
-
|
539
|
-
Description: '
|
540
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
555
|
+
Lint/MissingCopEnableDirective:
|
556
|
+
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
|
541
557
|
Enabled: true
|
542
558
|
|
543
|
-
|
544
|
-
Description:
|
545
|
-
Add underscores to large numeric literals to improve their
|
546
|
-
readability.
|
547
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
559
|
+
Lint/MultipleCompare:
|
560
|
+
Description: "Use `&&` operator to compare multiple value."
|
548
561
|
Enabled: true
|
549
562
|
|
550
|
-
|
551
|
-
Description: '
|
552
|
-
StyleGuide: '
|
563
|
+
Lint/NestedMethodDefinition:
|
564
|
+
Description: 'Do not use nested method definitions.'
|
565
|
+
StyleGuide: '#no-nested-methods'
|
553
566
|
Enabled: true
|
554
567
|
|
555
|
-
|
556
|
-
Description:
|
557
|
-
Checks for the use of predicate- or comparison methods for
|
558
|
-
numeric comparisons.
|
568
|
+
Lint/NestedPercentLiteral:
|
569
|
+
Description: 'Checks for nested percent literals.'
|
559
570
|
Enabled: true
|
560
571
|
|
561
|
-
|
562
|
-
Description:
|
563
|
-
|
564
|
-
|
565
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
572
|
+
Lint/NextWithoutAccumulator:
|
573
|
+
Description: >-
|
574
|
+
Do not omit the accumulator when calling `next`
|
575
|
+
in a `reduce`/`inject` block.
|
566
576
|
Enabled: true
|
567
577
|
|
568
|
-
|
569
|
-
Description: '
|
570
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
578
|
+
Lint/NonLocalExitFromIterator:
|
579
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
571
580
|
Enabled: true
|
572
581
|
|
573
|
-
|
582
|
+
Lint/ParenthesesAsGroupedExpression:
|
574
583
|
Description: >-
|
575
|
-
Checks for
|
576
|
-
|
577
|
-
StyleGuide: '
|
584
|
+
Checks for method calls with a space before the opening
|
585
|
+
parenthesis.
|
586
|
+
StyleGuide: '#parens-no-spaces'
|
578
587
|
Enabled: true
|
579
588
|
|
580
|
-
|
589
|
+
Lint/PercentStringArray:
|
581
590
|
Description: >-
|
582
|
-
|
583
|
-
It will only warn when the number of variables
|
584
|
-
matches on both sides of the assignment.
|
585
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
|
591
|
+
Checks for unwanted commas and quotes in %w/%W literals.
|
586
592
|
Enabled: true
|
587
593
|
|
588
|
-
|
594
|
+
Lint/PercentSymbolArray:
|
589
595
|
Description: >-
|
590
|
-
|
591
|
-
if/unless/while.
|
592
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
|
596
|
+
Checks for unwanted commas and colons in %i/%I literals.
|
593
597
|
Enabled: true
|
594
598
|
|
595
|
-
|
596
|
-
Description:
|
597
|
-
|
599
|
+
Lint/RandOne:
|
600
|
+
Description: >-
|
601
|
+
Checks for `rand(1)` calls. Such calls always return `0`
|
602
|
+
and most likely a mistake.
|
598
603
|
Enabled: true
|
599
604
|
|
600
|
-
|
601
|
-
Description: 'Checks
|
605
|
+
Lint/RedundantWithIndex:
|
606
|
+
Description: 'Checks for redundant `with_index`.'
|
602
607
|
Enabled: true
|
603
608
|
|
604
|
-
|
605
|
-
Description: '
|
606
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
609
|
+
Lint/RedundantWithObject:
|
610
|
+
Description: 'Checks for redundant `with_object`.'
|
607
611
|
Enabled: true
|
608
612
|
|
609
|
-
|
610
|
-
Description:
|
611
|
-
|
613
|
+
Lint/RegexpAsCondition:
|
614
|
+
Description: >-
|
615
|
+
Do not use regexp literal as a condition.
|
616
|
+
The regexp literal matches `$_` implicitly.
|
612
617
|
Enabled: true
|
613
618
|
|
614
|
-
|
615
|
-
Description:
|
616
|
-
|
619
|
+
Lint/RequireParentheses:
|
620
|
+
Description: >-
|
621
|
+
Use parentheses in the method call to avoid confusion
|
622
|
+
about precedence.
|
617
623
|
Enabled: true
|
618
624
|
|
619
|
-
|
620
|
-
Description: '
|
621
|
-
StyleGuide: '
|
625
|
+
Lint/RescueException:
|
626
|
+
Description: 'Avoid rescuing the Exception class.'
|
627
|
+
StyleGuide: '#no-blind-rescues'
|
622
628
|
Enabled: true
|
623
629
|
|
624
|
-
|
625
|
-
Description:
|
626
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
|
630
|
+
Lint/RescueType:
|
631
|
+
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
627
632
|
Enabled: true
|
628
633
|
|
629
|
-
|
630
|
-
Description:
|
631
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
|
634
|
+
Lint/ReturnInVoidContext:
|
635
|
+
Description: 'Checks for return in void context.'
|
632
636
|
Enabled: true
|
633
637
|
|
634
|
-
|
635
|
-
Description:
|
638
|
+
Lint/SafeNavigationChain:
|
639
|
+
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
636
640
|
Enabled: true
|
637
641
|
|
638
|
-
|
639
|
-
Description:
|
642
|
+
Lint/ScriptPermission:
|
643
|
+
Description: 'Grant script file execute permission.'
|
640
644
|
Enabled: true
|
641
645
|
|
642
|
-
|
643
|
-
Description:
|
644
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
|
646
|
+
Lint/ShadowedArgument:
|
647
|
+
Description: 'Avoid reassigning arguments before they were used.'
|
645
648
|
Enabled: true
|
646
649
|
|
647
|
-
|
648
|
-
Description:
|
649
|
-
|
650
|
+
Lint/ShadowedException:
|
651
|
+
Description: >-
|
652
|
+
Avoid rescuing a higher level exception
|
653
|
+
before a lower level exception.
|
650
654
|
Enabled: true
|
651
655
|
|
652
|
-
|
653
|
-
Description:
|
654
|
-
|
656
|
+
Lint/ShadowingOuterLocalVariable:
|
657
|
+
Description: >-
|
658
|
+
Do not use the same name as outer local variable
|
659
|
+
for block arguments or block local variables.
|
655
660
|
Enabled: true
|
656
661
|
|
657
|
-
|
658
|
-
Description: '
|
662
|
+
Lint/StringConversionInInterpolation:
|
663
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
664
|
+
StyleGuide: '#no-to-s'
|
659
665
|
Enabled: true
|
660
666
|
|
661
|
-
|
662
|
-
Description: '
|
663
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
|
667
|
+
Lint/Syntax:
|
668
|
+
Description: 'Checks syntax error'
|
664
669
|
Enabled: true
|
665
670
|
|
666
|
-
|
667
|
-
Description:
|
668
|
-
Checks for places where self-assignment shorthand should have
|
669
|
-
been used.
|
670
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
671
|
+
Lint/UnderscorePrefixedVariableName:
|
672
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
671
673
|
Enabled: true
|
672
674
|
|
673
|
-
|
674
|
-
Description:
|
675
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
|
675
|
+
Lint/UnifiedInteger:
|
676
|
+
Description: 'Use Integer instead of Fixnum or Bignum'
|
676
677
|
Enabled: true
|
677
678
|
|
678
|
-
|
679
|
-
Description:
|
680
|
-
|
679
|
+
Lint/UnneededDisable:
|
680
|
+
Description: >-
|
681
|
+
Checks for rubocop:disable comments that can be removed.
|
682
|
+
Note: this cop is not disabled when disabling all cops.
|
683
|
+
It must be explicitly disabled.
|
681
684
|
Enabled: true
|
682
685
|
|
683
|
-
|
684
|
-
Description: '
|
685
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
686
|
+
Lint/UnneededRequireStatement:
|
687
|
+
Description: 'Checks for unnecessary `require` statement.'
|
686
688
|
Enabled: true
|
687
689
|
|
688
|
-
|
689
|
-
Description: '
|
690
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
690
|
+
Lint/UnneededSplatExpansion:
|
691
|
+
Description: 'Checks for splat unnecessarily being called on literals'
|
691
692
|
Enabled: true
|
692
693
|
|
693
|
-
|
694
|
-
Description:
|
695
|
-
Checks that exactly one space is used between a method name
|
696
|
-
and the first argument for method calls without parentheses.
|
694
|
+
Lint/UnreachableCode:
|
695
|
+
Description: 'Unreachable code.'
|
697
696
|
Enabled: true
|
698
697
|
|
699
|
-
|
700
|
-
Description: '
|
701
|
-
StyleGuide: '
|
698
|
+
Lint/UnusedBlockArgument:
|
699
|
+
Description: 'Checks for unused block arguments.'
|
700
|
+
StyleGuide: '#underscore-unused-vars'
|
702
701
|
Enabled: true
|
703
702
|
|
704
|
-
|
705
|
-
Description: '
|
706
|
-
StyleGuide: '
|
703
|
+
Lint/UnusedMethodArgument:
|
704
|
+
Description: 'Checks for unused method arguments.'
|
705
|
+
StyleGuide: '#underscore-unused-vars'
|
707
706
|
Enabled: true
|
708
707
|
|
709
|
-
|
708
|
+
Lint/UriEscapeUnescape:
|
710
709
|
Description: >-
|
711
|
-
|
712
|
-
|
713
|
-
|
710
|
+
`URI.escape` method is obsolete and should not be used. Instead, use
|
711
|
+
`CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
|
712
|
+
depending on your specific use case.
|
713
|
+
Also `URI.unescape` method is obsolete and should not be used. Instead, use
|
714
|
+
`CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
|
715
|
+
depending on your specific use case.
|
714
716
|
Enabled: true
|
715
717
|
|
716
|
-
|
717
|
-
Description:
|
718
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
718
|
+
Lint/UriRegexp:
|
719
|
+
Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
|
719
720
|
Enabled: true
|
720
721
|
|
721
|
-
|
722
|
-
Description: '
|
723
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
722
|
+
Lint/UselessAccessModifier:
|
723
|
+
Description: 'Checks for useless access modifiers.'
|
724
724
|
Enabled: true
|
725
|
+
ContextCreatingMethods: []
|
726
|
+
MethodCreatingMethods: []
|
725
727
|
|
726
|
-
|
727
|
-
Description:
|
728
|
-
|
729
|
-
before it.
|
728
|
+
Lint/UselessAssignment:
|
729
|
+
Description: 'Checks for useless assignment to a local variable.'
|
730
|
+
StyleGuide: '#underscore-unused-vars'
|
730
731
|
Enabled: true
|
731
732
|
|
732
|
-
|
733
|
-
Description: '
|
733
|
+
Lint/UselessComparison:
|
734
|
+
Description: 'Checks for comparison of something with itself.'
|
734
735
|
Enabled: true
|
735
736
|
|
736
|
-
|
737
|
-
Description:
|
738
|
-
Checks for missing space between code and a comment on the
|
739
|
-
same line.
|
737
|
+
Lint/UselessElseWithoutRescue:
|
738
|
+
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
740
739
|
Enabled: true
|
741
740
|
|
742
|
-
|
743
|
-
Description: '
|
741
|
+
Lint/UselessSetterCall:
|
742
|
+
Description: 'Checks for useless setter call to a local variable.'
|
744
743
|
Enabled: true
|
745
744
|
|
746
|
-
|
747
|
-
Description:
|
748
|
-
Checks that block braces have or don't have surrounding space.
|
749
|
-
For blocks taking parameters, checks that the left brace has
|
750
|
-
or doesn't have trailing space.
|
745
|
+
Lint/Void:
|
746
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
751
747
|
Enabled: true
|
752
748
|
|
753
|
-
|
754
|
-
Description: 'Checks the spacing inside and after block parameters pipes.'
|
755
|
-
Enabled: true
|
749
|
+
#################### Metrics ###############################
|
756
750
|
|
757
|
-
|
751
|
+
Metrics/AbcSize:
|
758
752
|
Description: >-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
|
753
|
+
A calculated magnitude based on number of assignments,
|
754
|
+
branches, and conditions.
|
755
|
+
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
|
763
756
|
Enabled: true
|
764
757
|
|
765
|
-
|
766
|
-
Description: '
|
758
|
+
Metrics/BlockLength:
|
759
|
+
Description: 'Avoid long blocks with many lines.'
|
767
760
|
Enabled: true
|
768
761
|
|
769
|
-
|
770
|
-
Description: '
|
771
|
-
StyleGuide: '
|
762
|
+
Metrics/BlockNesting:
|
763
|
+
Description: 'Avoid excessive block nesting'
|
764
|
+
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
772
765
|
Enabled: true
|
773
766
|
|
774
|
-
|
775
|
-
Description: '
|
767
|
+
Metrics/ClassLength:
|
768
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
776
769
|
Enabled: true
|
777
770
|
|
778
|
-
|
779
|
-
Description:
|
771
|
+
Metrics/CyclomaticComplexity:
|
772
|
+
Description: >-
|
773
|
+
A complexity metric that is strongly correlated to the number
|
774
|
+
of test cases needed to validate a method.
|
780
775
|
Enabled: true
|
781
776
|
|
782
|
-
|
783
|
-
Description: '
|
784
|
-
StyleGuide: '
|
777
|
+
Metrics/LineLength:
|
778
|
+
Description: 'Limit lines to 80 characters.'
|
779
|
+
StyleGuide: '#80-character-limits'
|
785
780
|
Enabled: true
|
786
781
|
|
787
|
-
|
788
|
-
Description:
|
789
|
-
StyleGuide: '
|
782
|
+
Metrics/MethodLength:
|
783
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
784
|
+
StyleGuide: '#short-methods'
|
790
785
|
Enabled: true
|
791
786
|
|
792
|
-
|
793
|
-
Description: '
|
794
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
787
|
+
Metrics/ModuleLength:
|
788
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
795
789
|
Enabled: true
|
796
790
|
|
797
|
-
|
798
|
-
Description: '
|
799
|
-
StyleGuide: '
|
791
|
+
Metrics/ParameterLists:
|
792
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
793
|
+
StyleGuide: '#too-many-params'
|
800
794
|
Enabled: true
|
801
795
|
|
802
|
-
|
803
|
-
Description:
|
804
|
-
|
796
|
+
Metrics/PerceivedComplexity:
|
797
|
+
Description: >-
|
798
|
+
A complexity metric geared towards measuring complexity for a
|
799
|
+
human reader.
|
805
800
|
Enabled: true
|
806
801
|
|
807
|
-
|
808
|
-
Description: 'Avoid Perl-style global variables.'
|
809
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
810
|
-
Enabled: true
|
802
|
+
#################### Naming ##############################
|
811
803
|
|
812
|
-
|
813
|
-
Description:
|
814
|
-
StyleGuide: '
|
804
|
+
Naming/AccessorMethodName:
|
805
|
+
Description: Check the naming of accessor methods for get_/set_.
|
806
|
+
StyleGuide: '#accessor_mutator_method_names'
|
815
807
|
Enabled: true
|
816
808
|
|
817
|
-
|
818
|
-
Description: '
|
819
|
-
StyleGuide: '
|
809
|
+
Naming/AsciiIdentifiers:
|
810
|
+
Description: 'Use only ascii symbols in identifiers.'
|
811
|
+
StyleGuide: '#english-identifiers'
|
820
812
|
Enabled: true
|
821
813
|
|
822
|
-
|
823
|
-
Description:
|
824
|
-
|
825
|
-
strings match the configured preference.
|
814
|
+
Naming/BinaryOperatorParameterName:
|
815
|
+
Description: 'When defining binary operators, name the argument other.'
|
816
|
+
StyleGuide: '#other-arg'
|
826
817
|
Enabled: true
|
827
818
|
|
828
|
-
|
829
|
-
Description: '
|
830
|
-
StyleGuide: '
|
819
|
+
Naming/ClassAndModuleCamelCase:
|
820
|
+
Description: 'Use CamelCase for classes and modules.'
|
821
|
+
StyleGuide: '#camelcase-classes'
|
831
822
|
Enabled: true
|
832
823
|
|
833
|
-
|
834
|
-
Description: '
|
824
|
+
Naming/ConstantName:
|
825
|
+
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
826
|
+
StyleGuide: '#screaming-snake-case'
|
835
827
|
Enabled: true
|
836
828
|
|
837
|
-
|
838
|
-
Description: 'Use
|
829
|
+
Naming/FileName:
|
830
|
+
Description: 'Use snake_case for source file names.'
|
831
|
+
StyleGuide: '#snake-case-files'
|
839
832
|
Enabled: true
|
840
833
|
|
841
|
-
|
842
|
-
Description: '
|
843
|
-
StyleGuide: '
|
834
|
+
Naming/HeredocDelimiterCase:
|
835
|
+
Description: 'Use configured case for heredoc delimiters.'
|
836
|
+
StyleGuide: '#heredoc-delimiters'
|
844
837
|
Enabled: true
|
845
838
|
|
846
|
-
|
847
|
-
Description: '
|
839
|
+
Naming/HeredocDelimiterNaming:
|
840
|
+
Description: 'Use descriptive heredoc delimiters.'
|
841
|
+
StyleGuide: '#heredoc-delimiters'
|
848
842
|
Enabled: true
|
849
843
|
|
850
|
-
|
851
|
-
Description: '
|
852
|
-
StyleGuide: '
|
844
|
+
Naming/MethodName:
|
845
|
+
Description: 'Use the configured style when naming methods.'
|
846
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
853
847
|
Enabled: true
|
854
848
|
|
855
|
-
|
856
|
-
Description: '
|
857
|
-
StyleGuide: '
|
849
|
+
Naming/PredicateName:
|
850
|
+
Description: 'Check the names of predicate methods.'
|
851
|
+
StyleGuide: '#bool-methods-qmark'
|
858
852
|
Enabled: true
|
859
853
|
|
860
|
-
|
861
|
-
Description: '
|
862
|
-
StyleGuide: '
|
854
|
+
Naming/VariableName:
|
855
|
+
Description: 'Use the configured style when naming variables.'
|
856
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
863
857
|
Enabled: true
|
864
858
|
|
865
|
-
|
866
|
-
Description: '
|
867
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
859
|
+
Naming/VariableNumber:
|
860
|
+
Description: 'Use the configured style when numbering variables.'
|
868
861
|
Enabled: true
|
869
862
|
|
870
|
-
|
871
|
-
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
872
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
873
|
-
Enabled: true
|
863
|
+
#################### Performance ###########################
|
874
864
|
|
875
|
-
|
865
|
+
Performance/Caller:
|
876
866
|
Description: >-
|
877
|
-
|
878
|
-
case first.
|
879
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
|
867
|
+
Use `caller(n..n)` instead of `caller`.
|
880
868
|
Enabled: true
|
881
869
|
|
882
|
-
|
883
|
-
Description:
|
870
|
+
Performance/CaseWhenSplat:
|
871
|
+
Description: >-
|
872
|
+
Place `when` conditions that use splat at the end
|
873
|
+
of the list of `when` branches.
|
884
874
|
Enabled: true
|
885
875
|
|
886
|
-
|
887
|
-
Description:
|
876
|
+
Performance/Casecmp:
|
877
|
+
Description: >-
|
878
|
+
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
|
879
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
|
888
880
|
Enabled: true
|
889
881
|
|
890
|
-
|
891
|
-
Description: '
|
892
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
|
882
|
+
Performance/CompareWithBlock:
|
883
|
+
Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
|
893
884
|
Enabled: true
|
894
885
|
|
895
|
-
|
886
|
+
Performance/Count:
|
896
887
|
Description: >-
|
897
|
-
|
898
|
-
|
899
|
-
|
888
|
+
Use `count` instead of `select...size`, `reject...size`,
|
889
|
+
`select...count`, `reject...count`, `select...length`,
|
890
|
+
and `reject...length`.
|
891
|
+
# This cop has known compatibility issues with `ActiveRecord` and other
|
892
|
+
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
893
|
+
# For more information, see the documentation in the cop itself.
|
894
|
+
# If you understand the known risk, you can disable `SafeMode`.
|
895
|
+
SafeMode: true
|
900
896
|
Enabled: true
|
901
897
|
|
902
|
-
|
898
|
+
Performance/Detect:
|
903
899
|
Description: >-
|
904
|
-
|
905
|
-
|
906
|
-
|
900
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
901
|
+
`select.last`, and `find_all.last`.
|
902
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
903
|
+
# This cop has known compatibility issues with `ActiveRecord` and other
|
904
|
+
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
905
|
+
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
906
|
+
# should be considered unsafe.
|
907
|
+
SafeMode: true
|
907
908
|
Enabled: true
|
908
909
|
|
909
|
-
|
910
|
-
Description:
|
911
|
-
|
910
|
+
Performance/DoubleStartEndWith:
|
911
|
+
Description: >-
|
912
|
+
Use `str.{start,end}_with?(x, ..., y, ...)`
|
913
|
+
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
912
914
|
Enabled: true
|
913
915
|
|
914
|
-
|
915
|
-
Description: 'Use
|
916
|
-
|
916
|
+
Performance/EndWith:
|
917
|
+
Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
|
918
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
919
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
920
|
+
# object. Switching these methods has to be done with knowledge of the types
|
921
|
+
# of the variables which rubocop doesn't have.
|
922
|
+
AutoCorrect: false
|
917
923
|
Enabled: true
|
918
924
|
|
919
|
-
|
920
|
-
Description: '
|
921
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
|
925
|
+
Performance/FixedSize:
|
926
|
+
Description: 'Do not compute the size of statically sized objects except in constants'
|
922
927
|
Enabled: true
|
923
928
|
|
924
|
-
|
929
|
+
Performance/FlatMap:
|
925
930
|
Description: >-
|
926
|
-
|
927
|
-
|
928
|
-
|
931
|
+
Use `Enumerable#flat_map`
|
932
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
933
|
+
or `Enumberable#collect..Array#flatten(1)`
|
934
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
929
935
|
Enabled: true
|
936
|
+
EnabledForFlattenWithoutParams: false
|
937
|
+
# If enabled, this cop will warn about usages of
|
938
|
+
# `flatten` being called without any parameters.
|
939
|
+
# This can be dangerous since `flat_map` will only flatten 1 level, and
|
940
|
+
# `flatten` without any parameters can flatten multiple levels.
|
930
941
|
|
931
|
-
|
932
|
-
Description:
|
933
|
-
|
942
|
+
Performance/HashEachMethods:
|
943
|
+
Description: >-
|
944
|
+
Use `Hash#each_key` and `Hash#each_value` instead of
|
945
|
+
`Hash#keys.each` and `Hash#values.each`.
|
946
|
+
StyleGuide: '#hash-each'
|
934
947
|
Enabled: true
|
948
|
+
AutoCorrect: false
|
935
949
|
|
936
|
-
|
937
|
-
Description: 'Use
|
950
|
+
Performance/LstripRstrip:
|
951
|
+
Description: 'Use `strip` instead of `lstrip.rstrip`.'
|
938
952
|
Enabled: true
|
939
953
|
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
Description: >-
|
944
|
-
A calculated magnitude based on number of assignments,
|
945
|
-
branches, and conditions.
|
946
|
-
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
|
954
|
+
Performance/RangeInclude:
|
955
|
+
Description: 'Use `Range#cover?` instead of `Range#include?`.'
|
956
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
|
947
957
|
Enabled: true
|
948
958
|
|
949
|
-
|
950
|
-
Description: '
|
951
|
-
|
959
|
+
Performance/RedundantBlockCall:
|
960
|
+
Description: 'Use `yield` instead of `block.call`.'
|
961
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode'
|
952
962
|
Enabled: true
|
953
963
|
|
954
|
-
|
955
|
-
Description:
|
964
|
+
Performance/RedundantMatch:
|
965
|
+
Description: >-
|
966
|
+
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
|
967
|
+
returned `MatchData` is not needed.
|
956
968
|
Enabled: true
|
957
969
|
|
958
|
-
|
959
|
-
Description: '
|
970
|
+
Performance/RedundantMerge:
|
971
|
+
Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
|
972
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
|
960
973
|
Enabled: true
|
961
974
|
|
962
|
-
|
963
|
-
Description:
|
964
|
-
A complexity metric that is strongly correlated to the number
|
965
|
-
of test cases needed to validate a method.
|
975
|
+
Performance/RedundantSortBy:
|
976
|
+
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
966
977
|
Enabled: true
|
967
978
|
|
968
|
-
|
969
|
-
Description:
|
970
|
-
|
979
|
+
Performance/RegexpMatch:
|
980
|
+
Description: >-
|
981
|
+
Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
|
982
|
+
`Regexp#===`, or `=~` when `MatchData` is not used.
|
971
983
|
Enabled: true
|
972
984
|
|
973
|
-
|
974
|
-
Description: '
|
975
|
-
|
985
|
+
Performance/ReverseEach:
|
986
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
987
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
976
988
|
Enabled: true
|
977
989
|
|
978
|
-
|
979
|
-
Description:
|
980
|
-
|
990
|
+
Performance/Sample:
|
991
|
+
Description: >-
|
992
|
+
Use `sample` instead of `shuffle.first`,
|
993
|
+
`shuffle.last`, and `shuffle[Integer]`.
|
994
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
981
995
|
Enabled: true
|
982
996
|
|
983
|
-
|
997
|
+
Performance/Size:
|
984
998
|
Description: >-
|
985
|
-
|
986
|
-
|
999
|
+
Use `size` instead of `count` for counting
|
1000
|
+
the number of elements in `Array` and `Hash`.
|
1001
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code'
|
987
1002
|
Enabled: true
|
988
1003
|
|
989
|
-
|
990
|
-
|
1004
|
+
Performance/StartWith:
|
1005
|
+
Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
|
1006
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
1007
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
1008
|
+
# object. Switching these methods has to be done with knowledge of the types
|
1009
|
+
# of the variables which rubocop doesn't have.
|
1010
|
+
AutoCorrect: false
|
1011
|
+
Enabled: true
|
991
1012
|
|
992
|
-
|
1013
|
+
Performance/StringReplacement:
|
993
1014
|
Description: >-
|
994
|
-
|
995
|
-
|
996
|
-
|
1015
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
1016
|
+
number of characters. Use `delete` instead of `gsub` when
|
1017
|
+
you are deleting characters.
|
1018
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
997
1019
|
Enabled: true
|
998
1020
|
|
999
|
-
|
1000
|
-
Description:
|
1001
|
-
|
1002
|
-
a method invocation without parentheses.
|
1021
|
+
Performance/TimesMap:
|
1022
|
+
Description: 'Checks for .times.map calls.'
|
1023
|
+
AutoCorrect: false
|
1003
1024
|
Enabled: true
|
1004
1025
|
|
1005
|
-
|
1006
|
-
Description:
|
1007
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
1026
|
+
Performance/UnfreezeString:
|
1027
|
+
Description: 'Use unary plus to get an unfrozen string literal.'
|
1008
1028
|
Enabled: true
|
1009
1029
|
|
1010
|
-
|
1011
|
-
Description: '
|
1030
|
+
Performance/UriDefaultParser:
|
1031
|
+
Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
|
1012
1032
|
Enabled: true
|
1013
1033
|
|
1014
|
-
|
1015
|
-
|
1034
|
+
#################### Rails #################################
|
1035
|
+
|
1036
|
+
Rails/ActionFilter:
|
1037
|
+
Description: 'Enforces consistent use of action filter methods.'
|
1016
1038
|
Enabled: true
|
1017
1039
|
|
1018
|
-
|
1040
|
+
Rails/ActiveSupportAliases:
|
1019
1041
|
Description: >-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1042
|
+
Avoid ActiveSupport aliases of standard ruby methods:
|
1043
|
+
`String#starts_with?`, `String#ends_with?`,
|
1044
|
+
`Array#append`, `Array#prepend`.
|
1023
1045
|
Enabled: true
|
1024
1046
|
|
1025
|
-
|
1026
|
-
Description: 'Check
|
1027
|
-
Enabled: true
|
1028
|
-
|
1029
|
-
Lint/DefEndAlignment:
|
1030
|
-
Description: 'Align ends corresponding to defs correctly.'
|
1047
|
+
Rails/ApplicationJob:
|
1048
|
+
Description: 'Check that jobs subclass ApplicationJob.'
|
1031
1049
|
Enabled: true
|
1032
1050
|
|
1033
|
-
|
1034
|
-
Description: 'Check
|
1051
|
+
Rails/ApplicationRecord:
|
1052
|
+
Description: 'Check that models subclass ApplicationRecord.'
|
1035
1053
|
Enabled: true
|
1036
1054
|
|
1037
|
-
|
1038
|
-
Description: '
|
1055
|
+
Rails/Blank:
|
1056
|
+
Description: 'Enforce using `blank?` and `present?`.'
|
1039
1057
|
Enabled: true
|
1058
|
+
# Convert checks for `nil` or `empty?` to `blank?`
|
1059
|
+
NilOrEmpty: true
|
1060
|
+
# Convert usages of not `present?` to `blank?`
|
1061
|
+
NotPresent: true
|
1062
|
+
# Convert usages of `unless` `present?` to `if` `blank?`
|
1063
|
+
UnlessPresent: true
|
1040
1064
|
|
1041
|
-
|
1042
|
-
Description:
|
1065
|
+
Rails/CreateTableWithTimestamps:
|
1066
|
+
Description: >-
|
1067
|
+
Checks the migration for which timestamps are not included
|
1068
|
+
when creating a new table.
|
1043
1069
|
Enabled: true
|
1044
1070
|
|
1045
|
-
|
1046
|
-
Description:
|
1071
|
+
Rails/Date:
|
1072
|
+
Description: >-
|
1073
|
+
Checks the correct usage of date aware methods,
|
1074
|
+
such as Date.today, Date.current etc.
|
1047
1075
|
Enabled: true
|
1048
1076
|
|
1049
|
-
|
1050
|
-
Description: '
|
1077
|
+
Rails/Delegate:
|
1078
|
+
Description: 'Prefer delegate method for delegations.'
|
1051
1079
|
Enabled: true
|
1052
1080
|
|
1053
|
-
|
1054
|
-
Description: '
|
1081
|
+
Rails/DelegateAllowBlank:
|
1082
|
+
Description: 'Do not use allow_blank as an option to delegate.'
|
1055
1083
|
Enabled: true
|
1056
1084
|
|
1057
|
-
|
1058
|
-
Description: '
|
1085
|
+
Rails/DynamicFindBy:
|
1086
|
+
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
|
1087
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
|
1059
1088
|
Enabled: true
|
1060
1089
|
|
1061
|
-
|
1062
|
-
Description: '
|
1090
|
+
Rails/EnumUniqueness:
|
1091
|
+
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
|
1063
1092
|
Enabled: true
|
1064
1093
|
|
1065
|
-
|
1066
|
-
Description:
|
1094
|
+
Rails/EnvironmentComparison:
|
1095
|
+
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
|
1067
1096
|
Enabled: true
|
1068
1097
|
|
1069
|
-
|
1070
|
-
Description:
|
1071
|
-
|
1098
|
+
Rails/Exit:
|
1099
|
+
Description: >-
|
1100
|
+
Favor `fail`, `break`, `return`, etc. over `exit` in
|
1101
|
+
application or library code outside of Rake files to avoid
|
1102
|
+
exits during unit testing or running in production.
|
1072
1103
|
Enabled: true
|
1073
1104
|
|
1074
|
-
|
1075
|
-
Description: '
|
1105
|
+
Rails/FilePath:
|
1106
|
+
Description: 'Use `Rails.root.join` for file path joining.'
|
1076
1107
|
Enabled: true
|
1077
1108
|
|
1078
|
-
|
1079
|
-
Description:
|
1080
|
-
|
1081
|
-
represent.
|
1109
|
+
Rails/FindBy:
|
1110
|
+
Description: 'Prefer find_by over where.first.'
|
1111
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
|
1082
1112
|
Enabled: true
|
1083
1113
|
|
1084
|
-
|
1085
|
-
Description: '
|
1114
|
+
Rails/FindEach:
|
1115
|
+
Description: 'Prefer all.find_each over all.find.'
|
1116
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
|
1086
1117
|
Enabled: true
|
1087
1118
|
|
1088
|
-
|
1089
|
-
Description:
|
1090
|
-
StyleGuide: 'https://github.com/bbatsov/
|
1119
|
+
Rails/HasAndBelongsToMany:
|
1120
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
1121
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
|
1091
1122
|
Enabled: true
|
1092
1123
|
|
1093
|
-
|
1094
|
-
Description:
|
1095
|
-
|
1096
|
-
could better be represented as a single string literal.
|
1124
|
+
Rails/HasManyOrHasOneDependent:
|
1125
|
+
Description: 'Define the dependent option to the has_many and has_one associations.'
|
1126
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has_many-has_one-dependent-option'
|
1097
1127
|
Enabled: true
|
1098
1128
|
|
1099
|
-
|
1100
|
-
Description:
|
1101
|
-
Checks for attempts to use `private` or `protected` to set
|
1102
|
-
the visibility of a class method, which does not work.
|
1129
|
+
Rails/HttpPositionalArguments:
|
1130
|
+
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
|
1103
1131
|
Enabled: true
|
1132
|
+
Include:
|
1133
|
+
- 'spec/**/*'
|
1134
|
+
- 'test/**/*'
|
1104
1135
|
|
1105
|
-
|
1106
|
-
Description: '
|
1136
|
+
Rails/InverseOf:
|
1137
|
+
Description: 'Checks for associations where the inverse cannot be determined automatically.'
|
1107
1138
|
Enabled: true
|
1108
1139
|
|
1109
|
-
|
1110
|
-
Description:
|
1111
|
-
|
1112
|
-
whitespace character.
|
1140
|
+
Rails/LexicallyScopedActionFilter:
|
1141
|
+
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
|
1142
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#lexically-scoped-action-filter'
|
1113
1143
|
Enabled: true
|
1114
1144
|
|
1115
|
-
|
1116
|
-
Description: '
|
1145
|
+
Rails/NotNullColumn:
|
1146
|
+
Description: 'Do not add a NOT NULL column without a default value'
|
1117
1147
|
Enabled: true
|
1118
1148
|
|
1119
|
-
|
1120
|
-
Description: 'Checks for
|
1149
|
+
Rails/Output:
|
1150
|
+
Description: 'Checks for calls to puts, print, etc.'
|
1121
1151
|
Enabled: true
|
1122
1152
|
|
1123
|
-
|
1124
|
-
Description:
|
1125
|
-
Use Kernel#loop with break rather than begin/end/until or
|
1126
|
-
begin/end/while for post-loop tests.
|
1127
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
1153
|
+
Rails/OutputSafety:
|
1154
|
+
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
1128
1155
|
Enabled: true
|
1129
1156
|
|
1130
|
-
|
1131
|
-
Description: '
|
1132
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
1157
|
+
Rails/PluralizationGrammar:
|
1158
|
+
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
|
1133
1159
|
Enabled: true
|
1134
1160
|
|
1135
|
-
|
1136
|
-
Description:
|
1137
|
-
Do not omit the accumulator when calling `next`
|
1138
|
-
in a `reduce`/`inject` block.
|
1161
|
+
Rails/Presence:
|
1162
|
+
Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
|
1139
1163
|
Enabled: true
|
1140
1164
|
|
1141
|
-
|
1142
|
-
Description: '
|
1165
|
+
Rails/Present:
|
1166
|
+
Description: 'Enforce using `blank?` and `present?`.'
|
1143
1167
|
Enabled: true
|
1168
|
+
NotNilAndNotEmpty: true
|
1169
|
+
# Convert checks for not `nil` and not `empty?` to `present?`
|
1170
|
+
NotBlank: true
|
1171
|
+
# Convert usages of not `blank?` to `present?`
|
1172
|
+
UnlessBlank: true
|
1173
|
+
# Convert usages of `unless` `blank?` to `if` `present?`
|
1144
1174
|
|
1145
|
-
|
1175
|
+
Rails/ReadWriteAttribute:
|
1146
1176
|
Description: >-
|
1147
|
-
Checks for
|
1148
|
-
|
1149
|
-
StyleGuide: 'https://github.com/bbatsov/
|
1177
|
+
Checks for read_attribute(:attr) and
|
1178
|
+
write_attribute(:attr, val).
|
1179
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
|
1150
1180
|
Enabled: true
|
1151
1181
|
|
1152
|
-
|
1153
|
-
Description:
|
1154
|
-
Checks for unwanted commas and quotes in %w/%W literals.
|
1182
|
+
Rails/RedundantReceiverInWithOptions:
|
1183
|
+
Description: 'Checks for redundant receiver in `with_options`.'
|
1155
1184
|
Enabled: true
|
1156
1185
|
|
1157
|
-
|
1158
|
-
Description:
|
1159
|
-
Checks for unwanted commas and colons in %i/%I literals.
|
1186
|
+
Rails/RelativeDateConstant:
|
1187
|
+
Description: 'Do not assign relative date to constants.'
|
1160
1188
|
Enabled: true
|
1161
1189
|
|
1162
|
-
|
1163
|
-
Description:
|
1164
|
-
Checks for `rand(1)` calls. Such calls always return `0`
|
1165
|
-
and most likely a mistake.
|
1190
|
+
Rails/RequestReferer:
|
1191
|
+
Description: 'Use consistent syntax for request.referer.'
|
1166
1192
|
Enabled: true
|
1167
1193
|
|
1168
|
-
|
1169
|
-
Description:
|
1170
|
-
|
1171
|
-
|
1194
|
+
Rails/ReversibleMigration:
|
1195
|
+
Description: 'Checks whether the change method of the migration file is reversible.'
|
1196
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#reversible-migration'
|
1197
|
+
Reference: 'http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
|
1172
1198
|
Enabled: true
|
1173
1199
|
|
1174
|
-
|
1175
|
-
Description: '
|
1176
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
|
1200
|
+
Rails/SafeNavigation:
|
1201
|
+
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
|
1177
1202
|
Enabled: true
|
1178
1203
|
|
1179
|
-
|
1180
|
-
Description:
|
1181
|
-
Avoid rescuing a higher level exception
|
1182
|
-
before a lower level exception.
|
1204
|
+
Rails/ScopeArgs:
|
1205
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
1183
1206
|
Enabled: true
|
1184
1207
|
|
1185
|
-
|
1208
|
+
Rails/SkipsModelValidations:
|
1186
1209
|
Description: >-
|
1187
|
-
|
1188
|
-
|
1210
|
+
Use methods that skips model validations with caution.
|
1211
|
+
See reference for more information.
|
1212
|
+
Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
|
1189
1213
|
Enabled: true
|
1190
1214
|
|
1191
|
-
|
1192
|
-
Description: 'Checks
|
1193
|
-
StyleGuide: 'https://github.com/bbatsov/
|
1215
|
+
Rails/TimeZone:
|
1216
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
1217
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
1218
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
1194
1219
|
Enabled: true
|
1195
1220
|
|
1196
|
-
|
1197
|
-
Description: '
|
1221
|
+
Rails/UniqBeforePluck:
|
1222
|
+
Description: 'Prefer the use of uniq or distinct before pluck.'
|
1198
1223
|
Enabled: true
|
1199
1224
|
|
1200
|
-
|
1201
|
-
Description:
|
1202
|
-
Checks for rubocop:disable comments that can be removed.
|
1203
|
-
Note: this cop is not disabled when disabling all cops.
|
1204
|
-
It must be explicitly disabled.
|
1225
|
+
Rails/UnknownEnv:
|
1226
|
+
Description: 'Use correct environment name.'
|
1205
1227
|
Enabled: true
|
1206
1228
|
|
1207
|
-
|
1208
|
-
Description: '
|
1209
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
1229
|
+
Rails/Validation:
|
1230
|
+
Description: 'Use validates :attribute, hash of validations.'
|
1210
1231
|
Enabled: true
|
1211
1232
|
|
1212
|
-
|
1213
|
-
Description: 'Checks for unused method arguments.'
|
1214
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
1215
|
-
Enabled: true
|
1233
|
+
#################### Security ##############################
|
1216
1234
|
|
1217
|
-
|
1218
|
-
Description: '
|
1235
|
+
Security/Eval:
|
1236
|
+
Description: 'The use of eval represents a serious security risk.'
|
1219
1237
|
Enabled: true
|
1220
1238
|
|
1221
|
-
|
1222
|
-
Description:
|
1239
|
+
Security/JSONLoad:
|
1240
|
+
Description: >-
|
1241
|
+
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
1242
|
+
security issues. See reference for more information.
|
1243
|
+
Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
1223
1244
|
Enabled: true
|
1224
|
-
|
1245
|
+
# Autocorrect here will change to a method that may cause crashes depending
|
1246
|
+
# on the value of the argument.
|
1247
|
+
AutoCorrect: false
|
1225
1248
|
|
1226
|
-
|
1227
|
-
Description:
|
1249
|
+
Security/MarshalLoad:
|
1250
|
+
Description: >-
|
1251
|
+
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
1252
|
+
security issues. See reference for more information.
|
1253
|
+
Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
|
1228
1254
|
Enabled: true
|
1229
1255
|
|
1230
|
-
|
1231
|
-
Description:
|
1232
|
-
|
1256
|
+
Security/YAMLLoad:
|
1257
|
+
Description: >-
|
1258
|
+
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
1259
|
+
security issues. See reference for more information.
|
1260
|
+
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
1233
1261
|
Enabled: true
|
1234
1262
|
|
1235
|
-
|
1236
|
-
Description: 'Checks for comparison of something with itself.'
|
1237
|
-
Enabled: true
|
1263
|
+
#################### Style ###############################
|
1238
1264
|
|
1239
|
-
|
1240
|
-
Description: '
|
1265
|
+
Style/Alias:
|
1266
|
+
Description: 'Use alias instead of alias_method.'
|
1267
|
+
StyleGuide: '#alias-method'
|
1241
1268
|
Enabled: true
|
1242
1269
|
|
1243
|
-
|
1244
|
-
Description: '
|
1270
|
+
Style/AndOr:
|
1271
|
+
Description: 'Use &&/|| instead of and/or.'
|
1272
|
+
StyleGuide: '#no-and-or-or'
|
1245
1273
|
Enabled: true
|
1246
1274
|
|
1247
|
-
|
1248
|
-
Description: '
|
1275
|
+
Style/ArrayJoin:
|
1276
|
+
Description: 'Use Array#join instead of Array#*.'
|
1277
|
+
StyleGuide: '#array-join'
|
1249
1278
|
Enabled: true
|
1250
1279
|
|
1251
|
-
|
1280
|
+
Style/AsciiComments:
|
1281
|
+
Description: 'Use only ascii symbols in comments.'
|
1282
|
+
StyleGuide: '#english-comments'
|
1283
|
+
Enabled: true
|
1252
1284
|
|
1253
|
-
|
1254
|
-
Description:
|
1255
|
-
|
1256
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
|
1285
|
+
Style/Attr:
|
1286
|
+
Description: 'Checks for uses of Module#attr.'
|
1287
|
+
StyleGuide: '#attr'
|
1257
1288
|
Enabled: true
|
1258
1289
|
|
1259
|
-
|
1260
|
-
Description:
|
1261
|
-
|
1262
|
-
of the list of `when` branches.
|
1290
|
+
Style/BarePercentLiterals:
|
1291
|
+
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
1292
|
+
StyleGuide: '#percent-q-shorthand'
|
1263
1293
|
Enabled: true
|
1264
1294
|
|
1265
|
-
|
1266
|
-
Description:
|
1267
|
-
|
1268
|
-
`select...count`, `reject...count`, `select...length`,
|
1269
|
-
and `reject...length`.
|
1270
|
-
# This cop has known compatibility issues with `ActiveRecord` and other
|
1271
|
-
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
1272
|
-
# For more information, see the documentation in the cop itself.
|
1273
|
-
# If you understand the known risk, you can disable `SafeMode`.
|
1274
|
-
SafeMode: true
|
1295
|
+
Style/BeginBlock:
|
1296
|
+
Description: 'Avoid the use of BEGIN blocks.'
|
1297
|
+
StyleGuide: '#no-BEGIN-blocks'
|
1275
1298
|
Enabled: true
|
1276
1299
|
|
1277
|
-
|
1278
|
-
Description:
|
1279
|
-
|
1280
|
-
`select.last`, and `find_all.last`.
|
1281
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
1282
|
-
# This cop has known compatibility issues with `ActiveRecord` and other
|
1283
|
-
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
1284
|
-
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
1285
|
-
# should be considered unsafe.
|
1286
|
-
SafeMode: true
|
1300
|
+
Style/BlockComments:
|
1301
|
+
Description: 'Do not use block comments.'
|
1302
|
+
StyleGuide: '#no-block-comments'
|
1287
1303
|
Enabled: true
|
1288
1304
|
|
1289
|
-
|
1305
|
+
Style/BlockDelimiters:
|
1290
1306
|
Description: >-
|
1291
|
-
|
1292
|
-
|
1307
|
+
Avoid using {...} for multi-line blocks (multiline chaining is
|
1308
|
+
always ugly).
|
1309
|
+
Prefer {...} over do...end for single-line blocks.
|
1310
|
+
StyleGuide: '#single-line-blocks'
|
1293
1311
|
Enabled: true
|
1294
1312
|
|
1295
|
-
|
1296
|
-
Description: '
|
1297
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
1313
|
+
Style/BracesAroundHashParameters:
|
1314
|
+
Description: 'Enforce braces style around hash parameters.'
|
1298
1315
|
Enabled: true
|
1299
1316
|
|
1300
|
-
|
1301
|
-
Description: '
|
1317
|
+
Style/CaseEquality:
|
1318
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
1319
|
+
StyleGuide: '#no-case-equality'
|
1302
1320
|
Enabled: true
|
1303
1321
|
|
1304
|
-
|
1305
|
-
Description:
|
1306
|
-
|
1307
|
-
instead of `Enumerable#map...Array#flatten(1)`
|
1308
|
-
or `Enumberable#collect..Array#flatten(1)`
|
1309
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
1322
|
+
Style/CharacterLiteral:
|
1323
|
+
Description: 'Checks for uses of character literals.'
|
1324
|
+
StyleGuide: '#no-character-literals'
|
1310
1325
|
Enabled: true
|
1311
|
-
EnabledForFlattenWithoutParams: false
|
1312
|
-
# If enabled, this cop will warn about usages of
|
1313
|
-
# `flatten` being called without any parameters.
|
1314
|
-
# This can be dangerous since `flat_map` will only flatten 1 level, and
|
1315
|
-
# `flatten` without any parameters can flatten multiple levels.
|
1316
1326
|
|
1317
|
-
|
1318
|
-
Description:
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1327
|
+
Style/ClassAndModuleChildren:
|
1328
|
+
Description: 'Checks style of children classes and modules.'
|
1329
|
+
StyleGuide: '#namespace-definition'
|
1330
|
+
# Moving from compact to nested children requires knowledge of whether the
|
1331
|
+
# outer parent is a module or a class. Moving from nested to compact requires
|
1332
|
+
# verification that the outer parent is defined elsewhere. Rubocop does not
|
1333
|
+
# have the knowledge to perform either operation safely and thus requires
|
1334
|
+
# manual oversight.
|
1323
1335
|
AutoCorrect: false
|
1336
|
+
Enabled: true
|
1324
1337
|
|
1325
|
-
|
1326
|
-
Description: '
|
1338
|
+
Style/ClassCheck:
|
1339
|
+
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
1327
1340
|
Enabled: true
|
1328
1341
|
|
1329
|
-
|
1330
|
-
Description: 'Use
|
1342
|
+
Style/ClassMethods:
|
1343
|
+
Description: 'Use self when defining module/class methods.'
|
1344
|
+
StyleGuide: '#def-self-class-methods'
|
1331
1345
|
Enabled: true
|
1332
1346
|
|
1333
|
-
|
1334
|
-
Description: '
|
1335
|
-
|
1347
|
+
Style/ClassVars:
|
1348
|
+
Description: 'Avoid the use of class variables.'
|
1349
|
+
StyleGuide: '#no-class-vars'
|
1336
1350
|
Enabled: true
|
1337
1351
|
|
1338
|
-
|
1339
|
-
Description: '
|
1340
|
-
|
1352
|
+
Style/ColonMethodCall:
|
1353
|
+
Description: 'Do not use :: for method call.'
|
1354
|
+
StyleGuide: '#double-colons'
|
1341
1355
|
Enabled: true
|
1342
1356
|
|
1343
|
-
|
1357
|
+
Style/ColonMethodDefinition:
|
1358
|
+
Description: 'Do not use :: for defining class methods.'
|
1359
|
+
StyleGuide: '#colon-method-definition'
|
1360
|
+
Enabled: true
|
1361
|
+
|
1362
|
+
Style/CommandLiteral:
|
1363
|
+
Description: 'Use `` or %x around command literals.'
|
1364
|
+
StyleGuide: '#percent-x'
|
1365
|
+
Enabled: true
|
1366
|
+
|
1367
|
+
Style/CommentAnnotation:
|
1344
1368
|
Description: >-
|
1345
|
-
|
1346
|
-
|
1369
|
+
Checks formatting of special comments
|
1370
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
1371
|
+
StyleGuide: '#annotate-keywords'
|
1347
1372
|
Enabled: true
|
1348
1373
|
|
1349
|
-
|
1350
|
-
Description: '
|
1351
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
|
1374
|
+
Style/CommentedKeyword:
|
1375
|
+
Description: 'Do not place comments on the same line as certain keywords.'
|
1352
1376
|
Enabled: true
|
1353
1377
|
|
1354
|
-
|
1355
|
-
Description:
|
1378
|
+
Style/ConditionalAssignment:
|
1379
|
+
Description: >-
|
1380
|
+
Use the return value of `if` and `case` statements for
|
1381
|
+
assignment to a variable and variable comparison instead
|
1382
|
+
of assigning that variable inside of each branch.
|
1356
1383
|
Enabled: true
|
1357
1384
|
|
1358
|
-
|
1359
|
-
Description: 'Use
|
1360
|
-
|
1385
|
+
Style/DateTime:
|
1386
|
+
Description: 'Use Date or Time over DateTime.'
|
1387
|
+
StyleGuide: '#date--time'
|
1361
1388
|
Enabled: true
|
1362
1389
|
|
1363
|
-
|
1390
|
+
Style/DefWithParentheses:
|
1391
|
+
Description: 'Use def with parentheses when there are arguments.'
|
1392
|
+
StyleGuide: '#method-parens'
|
1393
|
+
Enabled: true
|
1394
|
+
|
1395
|
+
Style/Dir:
|
1364
1396
|
Description: >-
|
1365
|
-
|
1366
|
-
|
1367
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
1397
|
+
Use the `__dir__` method to retrieve the canonicalized
|
1398
|
+
absolute path to the current file.
|
1368
1399
|
Enabled: true
|
1369
1400
|
|
1370
|
-
|
1401
|
+
Style/Documentation:
|
1402
|
+
Description: 'Document classes and non-namespace modules.'
|
1403
|
+
Enabled: true
|
1404
|
+
Exclude:
|
1405
|
+
- 'spec/**/*'
|
1406
|
+
- 'test/**/*'
|
1407
|
+
|
1408
|
+
Style/DoubleNegation:
|
1409
|
+
Description: 'Checks for uses of double negation (!!).'
|
1410
|
+
StyleGuide: '#no-bang-bang'
|
1411
|
+
Enabled: true
|
1412
|
+
|
1413
|
+
Style/EachForSimpleLoop:
|
1371
1414
|
Description: >-
|
1372
|
-
|
1373
|
-
|
1374
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
1415
|
+
Use `Integer#times` for a simple loop which iterates a fixed
|
1416
|
+
number of times.
|
1375
1417
|
Enabled: true
|
1376
1418
|
|
1377
|
-
|
1378
|
-
Description: '
|
1379
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
1419
|
+
Style/EachWithObject:
|
1420
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
1380
1421
|
Enabled: true
|
1381
1422
|
|
1382
|
-
|
1423
|
+
Style/EmptyBlockParameter:
|
1424
|
+
Description: 'Omit pipes for empty block parameters.'
|
1425
|
+
Enabled: true
|
1426
|
+
|
1427
|
+
Style/EmptyCaseCondition:
|
1428
|
+
Description: 'Avoid empty condition in case statements.'
|
1429
|
+
Enabled: true
|
1430
|
+
|
1431
|
+
Style/EmptyElse:
|
1432
|
+
Description: 'Avoid empty else-clauses.'
|
1433
|
+
Enabled: true
|
1434
|
+
|
1435
|
+
Style/EmptyLambdaParameter:
|
1436
|
+
Description: 'Omit parens for empty lambda parameters.'
|
1437
|
+
Enabled: true
|
1438
|
+
|
1439
|
+
Style/EmptyLiteral:
|
1440
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
1441
|
+
StyleGuide: '#literal-array-hash'
|
1442
|
+
Enabled: true
|
1443
|
+
|
1444
|
+
Style/EmptyMethod:
|
1445
|
+
Description: 'Checks the formatting of empty method definitions.'
|
1446
|
+
StyleGuide: '#no-single-line-methods'
|
1447
|
+
Enabled: true
|
1448
|
+
|
1449
|
+
Style/Encoding:
|
1450
|
+
Description: 'Use UTF-8 as the source file encoding.'
|
1451
|
+
StyleGuide: '#utf-8'
|
1452
|
+
Enabled: true
|
1453
|
+
|
1454
|
+
Style/EndBlock:
|
1455
|
+
Description: 'Avoid the use of END blocks.'
|
1456
|
+
StyleGuide: '#no-END-blocks'
|
1457
|
+
Enabled: true
|
1458
|
+
|
1459
|
+
Style/EvalWithLocation:
|
1460
|
+
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
1461
|
+
Enabled: true
|
1462
|
+
|
1463
|
+
Style/EvenOdd:
|
1464
|
+
Description: 'Favor the use of Integer#even? && Integer#odd?'
|
1465
|
+
StyleGuide: '#predicate-methods'
|
1466
|
+
Enabled: true
|
1467
|
+
|
1468
|
+
Style/FlipFlop:
|
1469
|
+
Description: 'Checks for flip flops'
|
1470
|
+
StyleGuide: '#no-flip-flops'
|
1471
|
+
Enabled: true
|
1472
|
+
|
1473
|
+
Style/For:
|
1474
|
+
Description: 'Checks use of for or each in multiline loops.'
|
1475
|
+
StyleGuide: '#no-for-loops'
|
1476
|
+
Enabled: true
|
1477
|
+
|
1478
|
+
Style/FormatString:
|
1479
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
1480
|
+
StyleGuide: '#sprintf'
|
1481
|
+
Enabled: true
|
1482
|
+
|
1483
|
+
Style/FormatStringToken:
|
1484
|
+
Description: 'Use a consistent style for format string tokens.'
|
1485
|
+
Enabled: true
|
1486
|
+
|
1487
|
+
Style/FrozenStringLiteralComment:
|
1383
1488
|
Description: >-
|
1384
|
-
|
1385
|
-
|
1386
|
-
you are deleting characters.
|
1387
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
1489
|
+
Add the frozen_string_literal comment to the top of files
|
1490
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
1388
1491
|
Enabled: true
|
1389
1492
|
|
1390
|
-
|
1391
|
-
Description: '
|
1493
|
+
Style/GlobalVars:
|
1494
|
+
Description: 'Do not introduce global variables.'
|
1495
|
+
StyleGuide: '#instance-vars'
|
1496
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
1392
1497
|
Enabled: true
|
1393
1498
|
|
1394
|
-
|
1499
|
+
Style/GuardClause:
|
1500
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
1501
|
+
StyleGuide: '#no-nested-conditionals'
|
1502
|
+
Enabled: true
|
1395
1503
|
|
1396
|
-
|
1397
|
-
Description:
|
1504
|
+
Style/HashSyntax:
|
1505
|
+
Description: >-
|
1506
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
1507
|
+
{ :a => 1, :b => 2 }.
|
1508
|
+
StyleGuide: '#hash-literals'
|
1398
1509
|
Enabled: true
|
1399
1510
|
|
1400
|
-
|
1511
|
+
Style/IdenticalConditionalBranches:
|
1401
1512
|
Description: >-
|
1402
|
-
|
1403
|
-
|
1513
|
+
Checks that conditional statements do not have an identical
|
1514
|
+
line at the end of each branch, which can validly be moved
|
1515
|
+
out of the conditional.
|
1404
1516
|
Enabled: true
|
1405
1517
|
|
1406
|
-
|
1407
|
-
Description: '
|
1518
|
+
Style/IfInsideElse:
|
1519
|
+
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
1408
1520
|
Enabled: true
|
1409
1521
|
|
1410
|
-
|
1522
|
+
Style/IfUnlessModifier:
|
1411
1523
|
Description: >-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1524
|
+
Favor modifier if/unless usage when you have a
|
1525
|
+
single-line body.
|
1526
|
+
StyleGuide: '#if-as-a-modifier'
|
1415
1527
|
Enabled: true
|
1416
1528
|
|
1417
|
-
|
1418
|
-
Description:
|
1419
|
-
|
1529
|
+
Style/IfUnlessModifierOfIfUnless:
|
1530
|
+
Description: >-
|
1531
|
+
Avoid modifier if/unless usage on conditionals.
|
1420
1532
|
Enabled: true
|
1421
1533
|
|
1422
|
-
|
1423
|
-
Description: '
|
1424
|
-
StyleGuide: '
|
1534
|
+
Style/IfWithSemicolon:
|
1535
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
1536
|
+
StyleGuide: '#no-semicolon-ifs'
|
1425
1537
|
Enabled: true
|
1426
1538
|
|
1427
|
-
|
1428
|
-
Description: '
|
1429
|
-
StyleGuide: '
|
1539
|
+
Style/InfiniteLoop:
|
1540
|
+
Description: 'Use Kernel#loop for infinite loops.'
|
1541
|
+
StyleGuide: '#infinite-loop'
|
1430
1542
|
Enabled: true
|
1431
1543
|
|
1432
|
-
|
1433
|
-
Description:
|
1544
|
+
Style/InverseMethods:
|
1545
|
+
Description: >-
|
1546
|
+
Use the inverse method instead of `!.method`
|
1547
|
+
if an inverse method is defined.
|
1434
1548
|
Enabled: true
|
1435
1549
|
|
1436
|
-
|
1437
|
-
Description: '
|
1550
|
+
Style/Lambda:
|
1551
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
1552
|
+
StyleGuide: '#lambda-multi-line'
|
1438
1553
|
Enabled: true
|
1439
1554
|
|
1440
|
-
|
1441
|
-
Description: '
|
1555
|
+
Style/LambdaCall:
|
1556
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
1557
|
+
StyleGuide: '#proc-call'
|
1442
1558
|
Enabled: true
|
1443
1559
|
|
1444
|
-
|
1560
|
+
Style/LineEndConcatenation:
|
1445
1561
|
Description: >-
|
1446
|
-
|
1447
|
-
|
1448
|
-
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
|
1562
|
+
Use \ instead of + or << to concatenate two string literals at
|
1563
|
+
line end.
|
1449
1564
|
Enabled: true
|
1450
1565
|
|
1451
|
-
|
1452
|
-
Description: '
|
1566
|
+
Style/MethodCallWithoutArgsParentheses:
|
1567
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
1568
|
+
StyleGuide: '#method-invocation-parens'
|
1453
1569
|
Enabled: true
|
1454
1570
|
|
1455
|
-
|
1456
|
-
Description:
|
1571
|
+
Style/MethodDefParentheses:
|
1572
|
+
Description: >-
|
1573
|
+
Checks if the method definitions have or don't have
|
1574
|
+
parentheses.
|
1575
|
+
StyleGuide: '#method-parens'
|
1457
1576
|
Enabled: true
|
1458
1577
|
|
1459
|
-
|
1460
|
-
Description: '
|
1461
|
-
StyleGuide: '
|
1462
|
-
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
1578
|
+
Style/MethodMissing:
|
1579
|
+
Description: 'Avoid using `method_missing`.'
|
1580
|
+
StyleGuide: '#no-method-missing'
|
1463
1581
|
Enabled: true
|
1464
1582
|
|
1465
|
-
|
1466
|
-
Description:
|
1583
|
+
Style/MinMax:
|
1584
|
+
Description: >-
|
1585
|
+
Use `Enumerable#minmax` instead of `Enumerable#min`
|
1586
|
+
and `Enumerable#max` in conjunction.'
|
1467
1587
|
Enabled: true
|
1468
1588
|
|
1469
|
-
|
1470
|
-
Description: '
|
1589
|
+
Style/MixinGrouping:
|
1590
|
+
Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
|
1591
|
+
StyleGuide: '#mixin-grouping'
|
1592
|
+
Enabled: true
|
1593
|
+
|
1594
|
+
Style/MixinUsage:
|
1595
|
+
Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
|
1596
|
+
Enabled: true
|
1597
|
+
|
1598
|
+
Style/ModuleFunction:
|
1599
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
1600
|
+
StyleGuide: '#module-function'
|
1601
|
+
Enabled: true
|
1602
|
+
|
1603
|
+
Style/MultilineBlockChain:
|
1604
|
+
Description: 'Avoid multi-line chains of blocks.'
|
1605
|
+
StyleGuide: '#single-line-blocks'
|
1606
|
+
Enabled: true
|
1607
|
+
|
1608
|
+
Style/MultilineIfModifier:
|
1609
|
+
Description: 'Only use if/unless modifiers on single line statements.'
|
1610
|
+
StyleGuide: '#no-multiline-if-modifiers'
|
1611
|
+
Enabled: true
|
1612
|
+
|
1613
|
+
Style/MultilineIfThen:
|
1614
|
+
Description: 'Do not use then for multi-line if/unless.'
|
1615
|
+
StyleGuide: '#no-then'
|
1616
|
+
Enabled: true
|
1617
|
+
|
1618
|
+
Style/MultilineMemoization:
|
1619
|
+
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
1620
|
+
Enabled: true
|
1621
|
+
|
1622
|
+
Style/MultilineTernaryOperator:
|
1623
|
+
Description: >-
|
1624
|
+
Avoid multi-line ?: (the ternary operator);
|
1625
|
+
use if/unless instead.
|
1626
|
+
StyleGuide: '#no-multiline-ternary'
|
1627
|
+
Enabled: true
|
1628
|
+
|
1629
|
+
Style/MultipleComparison:
|
1630
|
+
Description: >-
|
1631
|
+
Avoid comparing a variable with multiple items in a conditional,
|
1632
|
+
use Array#include? instead.
|
1633
|
+
Enabled: true
|
1634
|
+
|
1635
|
+
Style/MutableConstant:
|
1636
|
+
Description: 'Do not assign mutable objects to constants.'
|
1637
|
+
Enabled: true
|
1638
|
+
|
1639
|
+
Style/NegatedIf:
|
1640
|
+
Description: >-
|
1641
|
+
Favor unless over if for negative conditions
|
1642
|
+
(or control flow or).
|
1643
|
+
StyleGuide: '#unless-for-negatives'
|
1644
|
+
Enabled: true
|
1645
|
+
|
1646
|
+
Style/NegatedWhile:
|
1647
|
+
Description: 'Favor until over while for negative conditions.'
|
1648
|
+
StyleGuide: '#until-for-negatives'
|
1649
|
+
Enabled: true
|
1650
|
+
|
1651
|
+
Style/NestedModifier:
|
1652
|
+
Description: 'Avoid using nested modifiers.'
|
1653
|
+
StyleGuide: '#no-nested-modifiers'
|
1654
|
+
Enabled: true
|
1655
|
+
|
1656
|
+
Style/NestedParenthesizedCalls:
|
1657
|
+
Description: >-
|
1658
|
+
Parenthesize method calls which are nested inside the
|
1659
|
+
argument list of another parenthesized method call.
|
1660
|
+
Enabled: true
|
1661
|
+
|
1662
|
+
Style/NestedTernaryOperator:
|
1663
|
+
Description: 'Use one expression per branch in a ternary operator.'
|
1664
|
+
StyleGuide: '#no-nested-ternary'
|
1665
|
+
Enabled: true
|
1666
|
+
|
1667
|
+
Style/Next:
|
1668
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
1669
|
+
StyleGuide: '#no-nested-conditionals'
|
1670
|
+
Enabled: true
|
1671
|
+
|
1672
|
+
Style/NilComparison:
|
1673
|
+
Description: 'Prefer x.nil? to x == nil.'
|
1674
|
+
StyleGuide: '#predicate-methods'
|
1675
|
+
Enabled: true
|
1676
|
+
|
1677
|
+
Style/NonNilCheck:
|
1678
|
+
Description: 'Checks for redundant nil checks.'
|
1679
|
+
StyleGuide: '#no-non-nil-checks'
|
1680
|
+
Enabled: true
|
1681
|
+
|
1682
|
+
Style/Not:
|
1683
|
+
Description: 'Use ! instead of not.'
|
1684
|
+
StyleGuide: '#bang-not-not'
|
1685
|
+
Enabled: true
|
1686
|
+
|
1687
|
+
Style/NumericLiteralPrefix:
|
1688
|
+
Description: 'Use smallcase prefixes for numeric literals.'
|
1689
|
+
StyleGuide: '#numeric-literal-prefixes'
|
1690
|
+
Enabled: true
|
1691
|
+
|
1692
|
+
Style/NumericLiterals:
|
1693
|
+
Description: >-
|
1694
|
+
Add underscores to large numeric literals to improve their
|
1695
|
+
readability.
|
1696
|
+
StyleGuide: '#underscores-in-numerics'
|
1697
|
+
Enabled: true
|
1698
|
+
|
1699
|
+
Style/NumericPredicate:
|
1700
|
+
Description: >-
|
1701
|
+
Checks for the use of predicate- or comparison methods for
|
1702
|
+
numeric comparisons.
|
1703
|
+
StyleGuide: '#predicate-methods'
|
1704
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
1705
|
+
# object. Switching these methods has to be done with knowledge of the types
|
1706
|
+
# of the variables which rubocop doesn't have.
|
1707
|
+
AutoCorrect: false
|
1708
|
+
Enabled: true
|
1709
|
+
|
1710
|
+
Style/OneLineConditional:
|
1711
|
+
Description: >-
|
1712
|
+
Favor the ternary operator(?:) over
|
1713
|
+
if/then/else/end constructs.
|
1714
|
+
StyleGuide: '#ternary-operator'
|
1715
|
+
Enabled: true
|
1716
|
+
|
1717
|
+
Style/OptionalArguments:
|
1718
|
+
Description: >-
|
1719
|
+
Checks for optional arguments that do not appear at the end
|
1720
|
+
of the argument list
|
1721
|
+
StyleGuide: '#optional-arguments'
|
1722
|
+
Enabled: true
|
1723
|
+
|
1724
|
+
Style/OrAssignment:
|
1725
|
+
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
1726
|
+
StyleGuide: '#double-pipe-for-uninit'
|
1727
|
+
Enabled: true
|
1728
|
+
|
1729
|
+
Style/ParallelAssignment:
|
1730
|
+
Description: >-
|
1731
|
+
Check for simple usages of parallel assignment.
|
1732
|
+
It will only warn when the number of variables
|
1733
|
+
matches on both sides of the assignment.
|
1734
|
+
StyleGuide: '#parallel-assignment'
|
1735
|
+
Enabled: true
|
1736
|
+
|
1737
|
+
Style/ParenthesesAroundCondition:
|
1738
|
+
Description: >-
|
1739
|
+
Don't use parentheses around the condition of an
|
1740
|
+
if/unless/while.
|
1741
|
+
StyleGuide: '#no-parens-around-condition'
|
1742
|
+
Enabled: true
|
1743
|
+
|
1744
|
+
Style/PercentLiteralDelimiters:
|
1745
|
+
Description: 'Use `%`-literal delimiters consistently'
|
1746
|
+
StyleGuide: '#percent-literal-braces'
|
1747
|
+
Enabled: true
|
1748
|
+
|
1749
|
+
Style/PercentQLiterals:
|
1750
|
+
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
1751
|
+
Enabled: true
|
1752
|
+
|
1753
|
+
Style/PerlBackrefs:
|
1754
|
+
Description: 'Avoid Perl-style regex back references.'
|
1755
|
+
StyleGuide: '#no-perl-regexp-last-matchers'
|
1756
|
+
Enabled: true
|
1757
|
+
|
1758
|
+
Style/PreferredHashMethods:
|
1759
|
+
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
1760
|
+
StyleGuide: '#hash-key'
|
1761
|
+
Enabled: true
|
1762
|
+
|
1763
|
+
Style/Proc:
|
1764
|
+
Description: 'Use proc instead of Proc.new.'
|
1765
|
+
StyleGuide: '#proc'
|
1766
|
+
Enabled: true
|
1767
|
+
|
1768
|
+
Style/RaiseArgs:
|
1769
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
1770
|
+
StyleGuide: '#exception-class-messages'
|
1771
|
+
Enabled: true
|
1772
|
+
|
1773
|
+
Style/RandomWithOffset:
|
1774
|
+
Description: >-
|
1775
|
+
Prefer to use ranges when generating random numbers instead of
|
1776
|
+
integers with offsets.
|
1777
|
+
StyleGuide: '#random-numbers'
|
1778
|
+
Enabled: true
|
1779
|
+
|
1780
|
+
Style/RedundantBegin:
|
1781
|
+
Description: "Don't use begin blocks when they are not needed."
|
1782
|
+
StyleGuide: '#begin-implicit'
|
1783
|
+
Enabled: true
|
1784
|
+
|
1785
|
+
Style/RedundantConditional:
|
1786
|
+
Description: "Don't return true/false from a conditional."
|
1787
|
+
Enabled: true
|
1788
|
+
|
1789
|
+
Style/RedundantException:
|
1790
|
+
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
1791
|
+
StyleGuide: '#no-explicit-runtimeerror'
|
1792
|
+
Enabled: true
|
1793
|
+
|
1794
|
+
Style/RedundantFreeze:
|
1795
|
+
Description: "Checks usages of Object#freeze on immutable objects."
|
1796
|
+
Enabled: true
|
1797
|
+
|
1798
|
+
Style/RedundantParentheses:
|
1799
|
+
Description: "Checks for parentheses that seem not to serve any purpose."
|
1800
|
+
Enabled: true
|
1801
|
+
|
1802
|
+
Style/RedundantReturn:
|
1803
|
+
Description: "Don't use return where it's not required."
|
1804
|
+
StyleGuide: '#no-explicit-return'
|
1805
|
+
Enabled: true
|
1806
|
+
|
1807
|
+
Style/RedundantSelf:
|
1808
|
+
Description: "Don't use self where it's not needed."
|
1809
|
+
StyleGuide: '#no-self-unless-required'
|
1810
|
+
Enabled: true
|
1811
|
+
|
1812
|
+
Style/RegexpLiteral:
|
1813
|
+
Description: 'Use / or %r around regular expressions.'
|
1814
|
+
StyleGuide: '#percent-r'
|
1815
|
+
Enabled: true
|
1816
|
+
|
1817
|
+
Style/RescueModifier:
|
1818
|
+
Description: 'Avoid using rescue in its modifier form.'
|
1819
|
+
StyleGuide: '#no-rescue-modifiers'
|
1820
|
+
Enabled: true
|
1821
|
+
|
1822
|
+
Style/RescueStandardError:
|
1823
|
+
Description: 'Avoid rescuing without specifying an error class.'
|
1824
|
+
Enabled: true
|
1825
|
+
|
1826
|
+
Style/SafeNavigation:
|
1827
|
+
Description: >-
|
1828
|
+
This cop transforms usages of a method call safeguarded by
|
1829
|
+
a check for the existence of the object to
|
1830
|
+
safe navigation (`&.`).
|
1831
|
+
Enabled: true
|
1832
|
+
|
1833
|
+
Style/SelfAssignment:
|
1834
|
+
Description: >-
|
1835
|
+
Checks for places where self-assignment shorthand should have
|
1836
|
+
been used.
|
1837
|
+
StyleGuide: '#self-assignment'
|
1838
|
+
Enabled: true
|
1839
|
+
|
1840
|
+
Style/Semicolon:
|
1841
|
+
Description: "Don't use semicolons to terminate expressions."
|
1842
|
+
StyleGuide: '#no-semicolon'
|
1843
|
+
Enabled: true
|
1844
|
+
|
1845
|
+
Style/SignalException:
|
1846
|
+
Description: 'Checks for proper usage of fail and raise.'
|
1847
|
+
StyleGuide: '#prefer-raise-over-fail'
|
1848
|
+
Enabled: true
|
1849
|
+
|
1850
|
+
Style/SingleLineMethods:
|
1851
|
+
Description: 'Avoid single-line methods.'
|
1852
|
+
StyleGuide: '#no-single-line-methods'
|
1853
|
+
Enabled: true
|
1854
|
+
|
1855
|
+
Style/SpecialGlobalVars:
|
1856
|
+
Description: 'Avoid Perl-style global variables.'
|
1857
|
+
StyleGuide: '#no-cryptic-perlisms'
|
1858
|
+
Enabled: true
|
1859
|
+
|
1860
|
+
Style/StabbyLambdaParentheses:
|
1861
|
+
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
|
1862
|
+
StyleGuide: '#stabby-lambda-with-args'
|
1863
|
+
Enabled: true
|
1864
|
+
|
1865
|
+
Style/StderrPuts:
|
1866
|
+
Description: 'Use `warn` instead of `$stderr.puts`.'
|
1867
|
+
StyleGuide: '#warn'
|
1868
|
+
Enabled: true
|
1869
|
+
|
1870
|
+
Style/StringLiterals:
|
1871
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
1872
|
+
StyleGuide: '#consistent-string-literals'
|
1873
|
+
Enabled: true
|
1874
|
+
|
1875
|
+
Style/StringLiteralsInInterpolation:
|
1876
|
+
Description: >-
|
1877
|
+
Checks if uses of quotes inside expressions in interpolated
|
1878
|
+
strings match the configured preference.
|
1879
|
+
Enabled: true
|
1880
|
+
|
1881
|
+
Style/StructInheritance:
|
1882
|
+
Description: 'Checks for inheritance from Struct.new.'
|
1883
|
+
StyleGuide: '#no-extend-struct-new'
|
1884
|
+
Enabled: true
|
1885
|
+
|
1886
|
+
Style/SymbolArray:
|
1887
|
+
Description: 'Use %i or %I for arrays of symbols.'
|
1888
|
+
StyleGuide: '#percent-i'
|
1889
|
+
Enabled: true
|
1890
|
+
|
1891
|
+
Style/SymbolLiteral:
|
1892
|
+
Description: 'Use plain symbols instead of string symbols when possible.'
|
1893
|
+
Enabled: true
|
1894
|
+
|
1895
|
+
Style/SymbolProc:
|
1896
|
+
Description: 'Use symbols as procs instead of blocks when possible.'
|
1897
|
+
Enabled: true
|
1898
|
+
|
1899
|
+
Style/TernaryParentheses:
|
1900
|
+
Description: 'Checks for use of parentheses around ternary conditions.'
|
1901
|
+
Enabled: true
|
1902
|
+
|
1903
|
+
Style/TrailingBodyOnMethodDefinition:
|
1904
|
+
Description: 'Method body goes below definition.'
|
1905
|
+
Enabled: true
|
1906
|
+
|
1907
|
+
Style/TrailingCommaInArguments:
|
1908
|
+
Description: 'Checks for trailing comma in argument lists.'
|
1909
|
+
StyleGuide: '#no-trailing-params-comma'
|
1910
|
+
Enabled: true
|
1911
|
+
|
1912
|
+
Style/TrailingCommaInLiteral:
|
1913
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
1914
|
+
StyleGuide: '#no-trailing-array-commas'
|
1915
|
+
Enabled: true
|
1916
|
+
|
1917
|
+
Style/TrailingMethodEndStatement:
|
1918
|
+
Description: 'Checks for trailing end statement on line of method body.'
|
1919
|
+
Enabled: true
|
1920
|
+
|
1921
|
+
Style/TrailingUnderscoreVariable:
|
1922
|
+
Description: >-
|
1923
|
+
Checks for the usage of unneeded trailing underscores at the
|
1924
|
+
end of parallel variable assignment.
|
1925
|
+
AllowNamedUnderscoreVariables: true
|
1926
|
+
Enabled: true
|
1927
|
+
|
1928
|
+
Style/TrivialAccessors:
|
1929
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
1930
|
+
StyleGuide: '#attr_family'
|
1931
|
+
Enabled: true
|
1932
|
+
|
1933
|
+
Style/UnlessElse:
|
1934
|
+
Description: >-
|
1935
|
+
Do not use unless with else. Rewrite these with the positive
|
1936
|
+
case first.
|
1937
|
+
StyleGuide: '#no-else-with-unless'
|
1938
|
+
Enabled: true
|
1939
|
+
|
1940
|
+
Style/UnneededCapitalW:
|
1941
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
1942
|
+
Enabled: true
|
1943
|
+
|
1944
|
+
Style/UnneededInterpolation:
|
1945
|
+
Description: 'Checks for strings that are just an interpolated expression.'
|
1946
|
+
Enabled: true
|
1947
|
+
|
1948
|
+
Style/UnneededPercentQ:
|
1949
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
1950
|
+
StyleGuide: '#percent-q'
|
1951
|
+
Enabled: true
|
1952
|
+
|
1953
|
+
Style/VariableInterpolation:
|
1954
|
+
Description: >-
|
1955
|
+
Don't interpolate global, instance and class variables
|
1956
|
+
directly in strings.
|
1957
|
+
StyleGuide: '#curlies-interpolate'
|
1958
|
+
Enabled: true
|
1959
|
+
|
1960
|
+
Style/WhenThen:
|
1961
|
+
Description: 'Use when x then ... for one-line cases.'
|
1962
|
+
StyleGuide: '#one-line-cases'
|
1963
|
+
Enabled: true
|
1964
|
+
|
1965
|
+
Style/WhileUntilDo:
|
1966
|
+
Description: 'Checks for redundant do after while or until.'
|
1967
|
+
StyleGuide: '#no-multiline-while-do'
|
1968
|
+
Enabled: true
|
1969
|
+
|
1970
|
+
Style/WhileUntilModifier:
|
1971
|
+
Description: >-
|
1972
|
+
Favor modifier while/until usage when you have a
|
1973
|
+
single-line body.
|
1974
|
+
StyleGuide: '#while-as-a-modifier'
|
1975
|
+
Enabled: true
|
1976
|
+
|
1977
|
+
Style/WordArray:
|
1978
|
+
Description: 'Use %w or %W for arrays of words.'
|
1979
|
+
StyleGuide: '#percent-w'
|
1980
|
+
Enabled: true
|
1981
|
+
|
1982
|
+
Style/YodaCondition:
|
1983
|
+
Description: 'Do not use literals as the first operand of a comparison.'
|
1984
|
+
Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
|
1985
|
+
Enabled: true
|
1986
|
+
|
1987
|
+
Style/ZeroLengthPredicate:
|
1988
|
+
Description: 'Use #empty? when testing for objects of length 0.'
|
1471
1989
|
Enabled: true
|