rubocop 0.49.1 → 0.50.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/bin/rubocop +1 -1
- data/config/default.yml +160 -99
- data/config/disabled.yml +4 -5
- data/config/enabled.yml +149 -47
- data/lib/rubocop.rb +41 -14
- data/lib/rubocop/ast/builder.rb +4 -1
- data/lib/rubocop/ast/node.rb +36 -42
- data/lib/rubocop/ast/node/args_node.rb +1 -13
- data/lib/rubocop/ast/node/array_node.rb +9 -0
- data/lib/rubocop/ast/node/block_node.rb +9 -0
- data/lib/rubocop/ast/node/def_node.rb +71 -0
- data/lib/rubocop/ast/node/for_node.rb +8 -0
- data/lib/rubocop/ast/node/if_node.rb +10 -2
- data/lib/rubocop/ast/node/mixin/collection_node.rb +15 -0
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +174 -0
- data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +89 -0
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +18 -31
- data/lib/rubocop/ast/node/regexp_node.rb +35 -0
- data/lib/rubocop/ast/node/send_node.rb +1 -154
- data/lib/rubocop/ast/node/super_node.rb +3 -24
- data/lib/rubocop/ast/node/yield_node.rb +21 -0
- data/lib/rubocop/ast/traversal.rb +6 -6
- data/lib/rubocop/cli.rb +7 -3
- data/lib/rubocop/config.rb +45 -8
- data/lib/rubocop/config_loader.rb +7 -5
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +3 -3
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +64 -0
- data/lib/rubocop/cop/bundler/ordered_gems.rb +12 -12
- data/lib/rubocop/cop/commissioner.rb +8 -2
- data/lib/rubocop/cop/cop.rb +3 -1
- data/lib/rubocop/cop/generator.rb +94 -21
- data/lib/rubocop/cop/internal_affairs.rb +3 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +14 -3
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +43 -0
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +49 -0
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +1 -1
- data/lib/rubocop/cop/layout/access_modifier_indentation.rb +2 -3
- data/lib/rubocop/cop/layout/align_array.rb +2 -2
- data/lib/rubocop/cop/layout/align_hash.rb +2 -2
- data/lib/rubocop/cop/layout/align_parameters.rb +5 -11
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +5 -5
- data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/dot_position.rb +9 -0
- data/lib/rubocop/cop/layout/else_alignment.rb +30 -13
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +4 -0
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +20 -4
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +3 -3
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +3 -3
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +3 -3
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +5 -2
- data/lib/rubocop/cop/layout/indent_heredoc.rb +19 -24
- data/lib/rubocop/cop/layout/indentation_consistency.rb +1 -2
- data/lib/rubocop/cop/layout/indentation_width.rb +12 -8
- data/lib/rubocop/cop/layout/leading_comment_space.rb +33 -18
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +20 -17
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +3 -3
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +6 -0
- data/lib/rubocop/cop/layout/space_after_colon.rb +7 -0
- data/lib/rubocop/cop/layout/space_after_comma.rb +10 -0
- data/lib/rubocop/cop/layout/space_after_method_name.rb +5 -3
- data/lib/rubocop/cop/layout/space_after_not.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +13 -4
- data/lib/rubocop/cop/layout/space_around_keyword.rb +9 -5
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +54 -5
- data/lib/rubocop/cop/layout/space_before_comment.rb +7 -0
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +7 -0
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +8 -4
- data/lib/rubocop/cop/layout/tab.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +4 -2
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +15 -1
- data/lib/rubocop/cop/lint/block_alignment.rb +15 -6
- data/lib/rubocop/cop/lint/boolean_symbol.rb +38 -0
- data/lib/rubocop/cop/lint/condition_position.rb +5 -1
- data/lib/rubocop/cop/lint/debugger.rb +16 -9
- data/lib/rubocop/cop/lint/def_end_alignment.rb +4 -4
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +3 -3
- data/lib/rubocop/cop/lint/duplicate_methods.rb +73 -5
- data/lib/rubocop/cop/lint/duplicated_key.rb +1 -1
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/else_layout.rb +1 -1
- data/lib/rubocop/cop/lint/empty_expression.rb +1 -1
- data/lib/rubocop/cop/lint/empty_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/empty_when.rb +1 -1
- data/lib/rubocop/cop/lint/ensure_return.rb +1 -1
- data/lib/rubocop/cop/lint/float_out_of_range.rb +5 -5
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +35 -40
- data/lib/rubocop/cop/lint/handle_exceptions.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +18 -13
- data/lib/rubocop/cop/lint/inherit_exception.rb +8 -7
- data/lib/rubocop/cop/lint/interpolation_check.rb +36 -0
- data/lib/rubocop/cop/lint/literal_in_condition.rb +3 -3
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/multiple_compare.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +5 -7
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +1 -1
- data/lib/rubocop/cop/lint/percent_string_array.rb +3 -12
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
- data/lib/rubocop/cop/lint/rand_one.rb +7 -1
- data/lib/rubocop/cop/lint/redundant_with_index.rb +77 -0
- data/lib/rubocop/cop/lint/require_parentheses.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_type.rb +13 -6
- data/lib/rubocop/cop/lint/rescue_without_error_class.rb +38 -0
- data/lib/rubocop/cop/lint/return_in_void_context.rb +63 -0
- data/lib/rubocop/cop/lint/script_permission.rb +6 -0
- data/lib/rubocop/cop/lint/syntax.rb +17 -20
- data/lib/rubocop/cop/lint/unified_integer.rb +3 -2
- data/lib/rubocop/cop/lint/unneeded_disable.rb +1 -1
- data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +1 -1
- data/lib/rubocop/cop/lint/unreachable_code.rb +53 -8
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +74 -0
- data/lib/rubocop/cop/lint/uri_regexp.rb +73 -0
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +4 -8
- data/lib/rubocop/cop/lint/useless_setter_call.rb +10 -11
- data/lib/rubocop/cop/lint/void.rb +29 -23
- data/lib/rubocop/cop/metrics/line_length.rb +2 -2
- data/lib/rubocop/cop/metrics/method_length.rb +8 -3
- data/lib/rubocop/cop/metrics/parameter_lists.rb +5 -2
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +2 -2
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +12 -3
- data/lib/rubocop/cop/mixin/heredoc.rb +28 -0
- data/lib/rubocop/cop/mixin/method_complexity.rb +9 -6
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +68 -31
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +18 -0
- data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -1
- data/lib/rubocop/cop/mixin/percent_array.rb +52 -0
- data/lib/rubocop/cop/mixin/string_help.rb +1 -1
- data/lib/rubocop/cop/{style → naming}/accessor_method_name.rb +11 -12
- data/lib/rubocop/cop/{style → naming}/ascii_identifiers.rb +1 -1
- data/lib/rubocop/cop/{style/op_method.rb → naming/binary_operator_parameter_name.rb} +2 -2
- data/lib/rubocop/cop/{style → naming}/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/{style → naming}/constant_name.rb +1 -1
- data/lib/rubocop/cop/{style → naming}/file_name.rb +8 -4
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +68 -0
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +58 -0
- data/lib/rubocop/cop/{style → naming}/method_name.rb +1 -1
- data/lib/rubocop/cop/{style → naming}/predicate_name.rb +6 -7
- data/lib/rubocop/cop/{style → naming}/variable_name.rb +11 -15
- data/lib/rubocop/cop/{style → naming}/variable_number.rb +1 -1
- data/lib/rubocop/cop/performance/caller.rb +39 -11
- data/lib/rubocop/cop/performance/casecmp.rb +4 -4
- data/lib/rubocop/cop/performance/compare_with_block.rb +4 -4
- data/lib/rubocop/cop/performance/double_start_end_with.rb +4 -4
- data/lib/rubocop/cop/performance/end_with.rb +3 -3
- data/lib/rubocop/cop/performance/fixed_size.rb +1 -1
- data/lib/rubocop/cop/performance/hash_each_methods.rb +66 -25
- data/lib/rubocop/cop/performance/lstrip_rstrip.rb +2 -2
- data/lib/rubocop/cop/performance/range_include.rb +2 -2
- data/lib/rubocop/cop/performance/redundant_block_call.rb +6 -6
- data/lib/rubocop/cop/performance/redundant_match.rb +5 -5
- data/lib/rubocop/cop/performance/redundant_merge.rb +39 -23
- data/lib/rubocop/cop/performance/redundant_sort_by.rb +2 -2
- data/lib/rubocop/cop/performance/regexp_match.rb +13 -5
- data/lib/rubocop/cop/performance/size.rb +1 -1
- data/lib/rubocop/cop/performance/start_with.rb +3 -3
- data/lib/rubocop/cop/performance/times_map.rb +23 -12
- 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/active_support_aliases.rb +1 -1
- data/lib/rubocop/cop/rails/delegate.rb +36 -7
- data/lib/rubocop/cop/rails/delegate_allow_blank.rb +1 -1
- data/lib/rubocop/cop/rails/enum_uniqueness.rb +2 -2
- data/lib/rubocop/cop/rails/file_path.rb +3 -4
- data/lib/rubocop/cop/rails/find_each.rb +1 -1
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +48 -0
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +5 -5
- data/lib/rubocop/cop/rails/not_null_column.rb +1 -1
- data/lib/rubocop/cop/rails/pluralization_grammar.rb +2 -2
- data/lib/rubocop/cop/rails/relative_date_constant.rb +1 -1
- data/lib/rubocop/cop/rails/request_referer.rb +2 -2
- data/lib/rubocop/cop/rails/reversible_migration.rb +12 -12
- data/lib/rubocop/cop/rails/save_bang.rb +8 -6
- data/lib/rubocop/cop/rails/scope_args.rb +1 -1
- data/lib/rubocop/cop/security/eval.rb +2 -2
- data/lib/rubocop/cop/security/json_load.rb +2 -2
- data/lib/rubocop/cop/security/marshal_load.rb +2 -2
- data/lib/rubocop/cop/security/yaml_load.rb +2 -2
- data/lib/rubocop/cop/style/alias.rb +44 -20
- data/lib/rubocop/cop/style/and_or.rb +48 -34
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +1 -1
- data/lib/rubocop/cop/style/block_comments.rb +3 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +2 -1
- data/lib/rubocop/cop/style/command_literal.rb +20 -9
- data/lib/rubocop/cop/style/conditional_assignment.rb +30 -28
- data/lib/rubocop/cop/style/copyright.rb +10 -10
- data/lib/rubocop/cop/style/def_with_parentheses.rb +6 -5
- data/lib/rubocop/cop/style/dir.rb +52 -0
- data/lib/rubocop/cop/style/documentation_method.rb +2 -6
- data/lib/rubocop/cop/style/empty_case_condition.rb +1 -1
- data/lib/rubocop/cop/style/empty_else.rb +3 -2
- data/lib/rubocop/cop/style/empty_literal.rb +1 -2
- data/lib/rubocop/cop/style/empty_method.rb +27 -17
- data/lib/rubocop/cop/style/flip_flop.rb +2 -2
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
- data/lib/rubocop/cop/style/guard_clause.rb +4 -2
- data/lib/rubocop/cop/style/hash_syntax.rb +10 -10
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +5 -1
- data/lib/rubocop/cop/style/if_with_semicolon.rb +1 -1
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +4 -3
- data/lib/rubocop/cop/style/inline_comment.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +20 -8
- data/lib/rubocop/cop/style/lambda.rb +19 -9
- data/lib/rubocop/cop/style/lambda_call.rb +22 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +4 -20
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +6 -4
- data/lib/rubocop/cop/style/method_def_parentheses.rb +18 -26
- data/lib/rubocop/cop/style/method_missing.rb +5 -18
- data/lib/rubocop/cop/style/min_max.rb +67 -0
- data/lib/rubocop/cop/style/missing_else.rb +16 -3
- data/lib/rubocop/cop/style/mixin_grouping.rb +2 -2
- data/lib/rubocop/cop/style/module_function.rb +8 -4
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +5 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +25 -3
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +2 -6
- data/lib/rubocop/cop/style/negated_if.rb +8 -4
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +8 -8
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +14 -14
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +6 -2
- data/lib/rubocop/cop/style/numeric_literals.rb +2 -2
- data/lib/rubocop/cop/style/numeric_predicate.rb +8 -4
- data/lib/rubocop/cop/style/one_line_conditional.rb +8 -3
- data/lib/rubocop/cop/style/option_hash.rb +1 -1
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -2
- data/lib/rubocop/cop/style/or_assignment.rb +88 -0
- data/lib/rubocop/cop/style/parallel_assignment.rb +2 -2
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +12 -11
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/percent_q_literals.rb +2 -2
- data/lib/rubocop/cop/style/perl_backrefs.rb +1 -1
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +16 -17
- data/lib/rubocop/cop/style/redundant_begin.rb +6 -5
- data/lib/rubocop/cop/style/redundant_conditional.rb +95 -0
- data/lib/rubocop/cop/style/redundant_freeze.rb +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +13 -11
- data/lib/rubocop/cop/style/redundant_return.rb +23 -11
- data/lib/rubocop/cop/style/redundant_self.rb +18 -9
- data/lib/rubocop/cop/style/regexp_literal.rb +12 -4
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/return_nil.rb +98 -0
- data/lib/rubocop/cop/style/safe_navigation.rb +80 -43
- data/lib/rubocop/cop/style/single_line_block_params.rb +14 -13
- data/lib/rubocop/cop/style/single_line_methods.rb +9 -13
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +17 -39
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +22 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +5 -25
- data/lib/rubocop/cop/style/symbol_literal.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +3 -18
- data/lib/rubocop/cop/style/ternary_parentheses.rb +14 -10
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +28 -9
- data/lib/rubocop/cop/style/trivial_accessors.rb +39 -56
- data/lib/rubocop/cop/style/unless_else.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_percent_q.rb +1 -1
- data/lib/rubocop/cop/style/variable_interpolation.rb +8 -3
- data/lib/rubocop/cop/style/word_array.rb +7 -24
- data/lib/rubocop/cop/style/yoda_condition.rb +49 -14
- data/lib/rubocop/cop/style/zero_length_predicate.rb +25 -18
- data/lib/rubocop/cop/team.rb +16 -8
- data/lib/rubocop/cop/util.rb +11 -0
- data/lib/rubocop/formatter/disabled_config_formatter.rb +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +2 -1
- data/lib/rubocop/formatter/offense_count_formatter.rb +2 -0
- data/lib/rubocop/formatter/simple_text_formatter.rb +1 -1
- data/lib/rubocop/formatter/tap_formatter.rb +71 -0
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +2 -0
- data/lib/rubocop/node_pattern.rb +44 -26
- data/lib/rubocop/options.rb +1 -0
- data/lib/rubocop/processed_source.rb +3 -1
- data/lib/rubocop/remote_config.rb +5 -1
- data/lib/rubocop/result_cache.rb +1 -0
- data/lib/rubocop/rspec/cop_helper.rb +10 -10
- data/lib/rubocop/rspec/expect_offense.rb +6 -8
- data/lib/rubocop/rspec/shared_examples.rb +8 -8
- data/lib/rubocop/string_util.rb +2 -0
- data/lib/rubocop/version.rb +1 -1
- metadata +51 -18
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +0 -41
- data/lib/rubocop/cop/mixin/on_method_def.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc27de01c8e40a15273487b5c90697374de840fa
|
4
|
+
data.tar.gz: 745535b26861520e259edd7bd596c64b69337d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c147e35b45939d5a54d225141c41fcb5740873ec98f0f914a0a0b9e9c9fdd5c00ed4ee79fc54b7e8e808fdeb2ca594b034700a4e1edb6b6ec2e7cd23e6d3dc
|
7
|
+
data.tar.gz: eca0914100842f7c36c082af77e4d780e5fd955642eb906d18eb9a7cc84bc8d7ddf445da7b89c29c3962cd063054aaa10a1755101e8ec7e6bc33fc948034576f
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](http://badge.fury.io/rb/rubocop)
|
2
2
|
[![Dependency Status](https://gemnasium.com/bbatsov/rubocop.svg)](https://gemnasium.com/bbatsov/rubocop)
|
3
3
|
[![Travis Status](https://travis-ci.org/bbatsov/rubocop.svg?branch=master)](https://travis-ci.org/bbatsov/rubocop)
|
4
|
-
[![Appveyor
|
4
|
+
[![Appveyor status](https://ci.appveyor.com/api/projects/status/e5jdwocv30oqm4sm?svg=true)](https://ci.appveyor.com/project/bbatsov/rubocop)
|
5
5
|
[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/bbatsov/rubocop.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
7
7
|
[![Inline docs](http://inch-ci.org/github/bbatsov/rubocop.svg)](http://inch-ci.org/github/bbatsov/rubocop)
|
@@ -51,7 +51,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
|
|
51
51
|
might want to use a conservative version locking in your `Gemfile`:
|
52
52
|
|
53
53
|
```rb
|
54
|
-
gem 'rubocop', '~> 0.
|
54
|
+
gem 'rubocop', '~> 0.50.0', require: false
|
55
55
|
```
|
56
56
|
|
57
57
|
## Quickstart
|
@@ -86,7 +86,9 @@ Here's a list of RuboCop's core developers:
|
|
86
86
|
* [Bozhidar Batsov](https://github.com/bbatsov)
|
87
87
|
* [Jonas Arvidsson](https://github.com/jonas054)
|
88
88
|
* [Yuji Nakayama](https://github.com/yujinakayama)
|
89
|
-
* [Evgeni Dzhelyov](https://github.com/edzhelyov)
|
89
|
+
* [Evgeni Dzhelyov](https://github.com/edzhelyov) (retired)
|
90
|
+
* [Ted Johansson](https://github.com/drenmi)
|
91
|
+
* [Masataka Kuwabara](https://github.com/pocke)
|
90
92
|
|
91
93
|
## Logo
|
92
94
|
|
data/bin/rubocop
CHANGED
data/config/default.yml
CHANGED
@@ -55,6 +55,7 @@ AllCops:
|
|
55
55
|
- '**/Vagabondfile'
|
56
56
|
- '**/Vagrantfile'
|
57
57
|
Exclude:
|
58
|
+
- 'node_modules/**/*'
|
58
59
|
- 'vendor/**/*'
|
59
60
|
# Default formatter will be used if no `-f/--format` option is given.
|
60
61
|
DefaultFormatter: progress
|
@@ -489,6 +490,9 @@ Layout/SpaceBeforeBlockBraces:
|
|
489
490
|
SupportedStyles:
|
490
491
|
- space
|
491
492
|
- no_space
|
493
|
+
SupportedStylesForEmptyBraces:
|
494
|
+
- space
|
495
|
+
- no_space
|
492
496
|
|
493
497
|
Layout/SpaceBeforeFirstArg:
|
494
498
|
# When `true`, allows most uses of extra spacing if the intent is to align
|
@@ -533,6 +537,118 @@ Layout/TrailingBlankLines:
|
|
533
537
|
- final_newline
|
534
538
|
- final_blank_line
|
535
539
|
|
540
|
+
#################### Naming ##########################
|
541
|
+
|
542
|
+
Naming/FileName:
|
543
|
+
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
544
|
+
# excludes here.
|
545
|
+
Exclude: []
|
546
|
+
# When `true`, requires that each source file should define a class or module
|
547
|
+
# with a name which matches the file name (converted to ... case).
|
548
|
+
# It further expects it to be nested inside modules which match the names
|
549
|
+
# of subdirectories in its path.
|
550
|
+
ExpectMatchingDefinition: false
|
551
|
+
# If non-`nil`, expect all source file names to match the following regex.
|
552
|
+
# Only the file name itself is matched, not the entire file path.
|
553
|
+
# Use anchors as necessary if you want to match the entire name rather than
|
554
|
+
# just a part of it.
|
555
|
+
Regex: ~
|
556
|
+
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
557
|
+
# report offending filenames for executable scripts (i.e. source
|
558
|
+
# files with a shebang in the first line).
|
559
|
+
IgnoreExecutableScripts: true
|
560
|
+
AllowedAcronyms:
|
561
|
+
- CLI
|
562
|
+
- DSL
|
563
|
+
- ACL
|
564
|
+
- API
|
565
|
+
- ASCII
|
566
|
+
- CPU
|
567
|
+
- CSS
|
568
|
+
- DNS
|
569
|
+
- EOF
|
570
|
+
- GUID
|
571
|
+
- HTML
|
572
|
+
- HTTP
|
573
|
+
- HTTPS
|
574
|
+
- ID
|
575
|
+
- IP
|
576
|
+
- JSON
|
577
|
+
- LHS
|
578
|
+
- QPS
|
579
|
+
- RAM
|
580
|
+
- RHS
|
581
|
+
- RPC
|
582
|
+
- SLA
|
583
|
+
- SMTP
|
584
|
+
- SQL
|
585
|
+
- SSH
|
586
|
+
- TCP
|
587
|
+
- TLS
|
588
|
+
- TTL
|
589
|
+
- UDP
|
590
|
+
- UI
|
591
|
+
- UID
|
592
|
+
- UUID
|
593
|
+
- URI
|
594
|
+
- URL
|
595
|
+
- UTF8
|
596
|
+
- VM
|
597
|
+
- XML
|
598
|
+
- XMPP
|
599
|
+
- XSRF
|
600
|
+
- XSS
|
601
|
+
|
602
|
+
Naming/HeredocDelimiterNaming:
|
603
|
+
Blacklist:
|
604
|
+
- END
|
605
|
+
- !ruby/regexp '/EO[A-Z]{1}/'
|
606
|
+
|
607
|
+
Naming/HeredocDelimiterCase:
|
608
|
+
EnforcedStyle: uppercase
|
609
|
+
SupportedStyles:
|
610
|
+
- lowercase
|
611
|
+
- uppercase
|
612
|
+
|
613
|
+
Naming/MethodName:
|
614
|
+
EnforcedStyle: snake_case
|
615
|
+
SupportedStyles:
|
616
|
+
- snake_case
|
617
|
+
- camelCase
|
618
|
+
|
619
|
+
Naming/PredicateName:
|
620
|
+
# Predicate name prefixes.
|
621
|
+
NamePrefix:
|
622
|
+
- is_
|
623
|
+
- has_
|
624
|
+
- have_
|
625
|
+
# Predicate name prefixes that should be removed.
|
626
|
+
NamePrefixBlacklist:
|
627
|
+
- is_
|
628
|
+
- has_
|
629
|
+
- have_
|
630
|
+
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
631
|
+
# should still be accepted
|
632
|
+
NameWhitelist:
|
633
|
+
- is_a?
|
634
|
+
# Exclude Rspec specs because there is a strong convention to write spec
|
635
|
+
# helpers in the form of `have_something` or `be_something`.
|
636
|
+
Exclude:
|
637
|
+
- 'spec/**/*'
|
638
|
+
|
639
|
+
Naming/VariableName:
|
640
|
+
EnforcedStyle: snake_case
|
641
|
+
SupportedStyles:
|
642
|
+
- snake_case
|
643
|
+
- camelCase
|
644
|
+
|
645
|
+
Naming/VariableNumber:
|
646
|
+
EnforcedStyle: normalcase
|
647
|
+
SupportedStyles:
|
648
|
+
- snake_case
|
649
|
+
- normalcase
|
650
|
+
- non_integer
|
651
|
+
|
536
652
|
#################### Style ###########################
|
537
653
|
|
538
654
|
Style/Alias:
|
@@ -773,66 +889,6 @@ Style/Encoding:
|
|
773
889
|
- never
|
774
890
|
AutoCorrectEncodingComment: '# encoding: utf-8'
|
775
891
|
|
776
|
-
Style/FileName:
|
777
|
-
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
778
|
-
# excludes here.
|
779
|
-
Exclude: []
|
780
|
-
# When `true`, requires that each source file should define a class or module
|
781
|
-
# with a name which matches the file name (converted to ... case).
|
782
|
-
# It further expects it to be nested inside modules which match the names
|
783
|
-
# of subdirectories in its path.
|
784
|
-
ExpectMatchingDefinition: false
|
785
|
-
# If non-`nil`, expect all source file names to match the following regex.
|
786
|
-
# Only the file name itself is matched, not the entire file path.
|
787
|
-
# Use anchors as necessary if you want to match the entire name rather than
|
788
|
-
# just a part of it.
|
789
|
-
Regex: ~
|
790
|
-
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
791
|
-
# report offending filenames for executable scripts (i.e. source
|
792
|
-
# files with a shebang in the first line).
|
793
|
-
IgnoreExecutableScripts: true
|
794
|
-
AllowedAcronyms:
|
795
|
-
- CLI
|
796
|
-
- DSL
|
797
|
-
- ACL
|
798
|
-
- API
|
799
|
-
- ASCII
|
800
|
-
- CPU
|
801
|
-
- CSS
|
802
|
-
- DNS
|
803
|
-
- EOF
|
804
|
-
- GUID
|
805
|
-
- HTML
|
806
|
-
- HTTP
|
807
|
-
- HTTPS
|
808
|
-
- ID
|
809
|
-
- IP
|
810
|
-
- JSON
|
811
|
-
- LHS
|
812
|
-
- QPS
|
813
|
-
- RAM
|
814
|
-
- RHS
|
815
|
-
- RPC
|
816
|
-
- SLA
|
817
|
-
- SMTP
|
818
|
-
- SQL
|
819
|
-
- SSH
|
820
|
-
- TCP
|
821
|
-
- TLS
|
822
|
-
- TTL
|
823
|
-
- UDP
|
824
|
-
- UI
|
825
|
-
- UID
|
826
|
-
- UUID
|
827
|
-
- URI
|
828
|
-
- URL
|
829
|
-
- UTF8
|
830
|
-
- VM
|
831
|
-
- XML
|
832
|
-
- XMPP
|
833
|
-
- XSRF
|
834
|
-
- XSS
|
835
|
-
|
836
892
|
# Checks use of for or each in multiline loops.
|
837
893
|
Style/For:
|
838
894
|
EnforcedStyle: each
|
@@ -947,12 +1003,6 @@ Style/MethodDefParentheses:
|
|
947
1003
|
- require_no_parentheses
|
948
1004
|
- require_no_parentheses_except_multiline
|
949
1005
|
|
950
|
-
Style/MethodName:
|
951
|
-
EnforcedStyle: snake_case
|
952
|
-
SupportedStyles:
|
953
|
-
- snake_case
|
954
|
-
- camelCase
|
955
|
-
|
956
1006
|
# Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
|
957
1007
|
# `module` bodies.
|
958
1008
|
Style/MixinGrouping:
|
@@ -985,6 +1035,26 @@ Style/NegatedIf:
|
|
985
1035
|
- prefix
|
986
1036
|
- postfix
|
987
1037
|
|
1038
|
+
Style/NestedParenthesizedCalls:
|
1039
|
+
Whitelist:
|
1040
|
+
- be
|
1041
|
+
- be_a
|
1042
|
+
- be_an
|
1043
|
+
- be_between
|
1044
|
+
- be_falsey
|
1045
|
+
- be_kind_of
|
1046
|
+
- be_instance_of
|
1047
|
+
- be_truthy
|
1048
|
+
- be_within
|
1049
|
+
- eq
|
1050
|
+
- eql
|
1051
|
+
- end_with
|
1052
|
+
- include
|
1053
|
+
- match
|
1054
|
+
- raise_error
|
1055
|
+
- respond_to
|
1056
|
+
- start_with
|
1057
|
+
|
988
1058
|
Style/Next:
|
989
1059
|
# With `always` all conditions at the end of an iteration needs to be
|
990
1060
|
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
@@ -1057,26 +1127,6 @@ Style/PercentQLiterals:
|
|
1057
1127
|
- lower_case_q # Use `%q` when possible, `%Q` when necessary
|
1058
1128
|
- upper_case_q # Always use `%Q`
|
1059
1129
|
|
1060
|
-
Style/PredicateName:
|
1061
|
-
# Predicate name prefixes.
|
1062
|
-
NamePrefix:
|
1063
|
-
- is_
|
1064
|
-
- has_
|
1065
|
-
- have_
|
1066
|
-
# Predicate name prefixes that should be removed.
|
1067
|
-
NamePrefixBlacklist:
|
1068
|
-
- is_
|
1069
|
-
- has_
|
1070
|
-
- have_
|
1071
|
-
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
1072
|
-
# should still be accepted
|
1073
|
-
NameWhitelist:
|
1074
|
-
- is_a?
|
1075
|
-
# Exclude Rspec specs because there is a strong convention to write spec
|
1076
|
-
# helpers in the form of `have_something` or `be_something`.
|
1077
|
-
Exclude:
|
1078
|
-
- 'spec/**/*'
|
1079
|
-
|
1080
1130
|
Style/PreferredHashMethods:
|
1081
1131
|
EnforcedStyle: short
|
1082
1132
|
SupportedStyles:
|
@@ -1107,6 +1157,12 @@ Style/RegexpLiteral:
|
|
1107
1157
|
# are found in the regexp string.
|
1108
1158
|
AllowInnerSlashes: false
|
1109
1159
|
|
1160
|
+
Style/ReturnNil:
|
1161
|
+
EnforcedStyle: return
|
1162
|
+
SupportedStyles:
|
1163
|
+
- return
|
1164
|
+
- return_nil
|
1165
|
+
|
1110
1166
|
Style/SafeNavigation:
|
1111
1167
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
1112
1168
|
# to whatever it used to return.
|
@@ -1258,19 +1314,6 @@ Style/TrivialAccessors:
|
|
1258
1314
|
- to_s
|
1259
1315
|
- to_sym
|
1260
1316
|
|
1261
|
-
Style/VariableName:
|
1262
|
-
EnforcedStyle: snake_case
|
1263
|
-
SupportedStyles:
|
1264
|
-
- snake_case
|
1265
|
-
- camelCase
|
1266
|
-
|
1267
|
-
Style/VariableNumber:
|
1268
|
-
EnforcedStyle: normalcase
|
1269
|
-
SupportedStyles:
|
1270
|
-
- snake_case
|
1271
|
-
- normalcase
|
1272
|
-
- non_integer
|
1273
|
-
|
1274
1317
|
Style/WhileUntilModifier:
|
1275
1318
|
MaxLineLength: 80
|
1276
1319
|
|
@@ -1289,6 +1332,14 @@ Style/WordArray:
|
|
1289
1332
|
# The regular expression `WordRegex` decides what is considered a word.
|
1290
1333
|
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
|
1291
1334
|
|
1335
|
+
Style/YodaCondition:
|
1336
|
+
EnforcedStyle: all_comparison_operators
|
1337
|
+
SupportedStyles:
|
1338
|
+
# check all comparison operators
|
1339
|
+
- all_comparison_operators
|
1340
|
+
# check only equality operators: `!=` and `==`
|
1341
|
+
- equality_operators_only
|
1342
|
+
|
1292
1343
|
#################### Metrics ###############################
|
1293
1344
|
|
1294
1345
|
Metrics/AbcSize:
|
@@ -1447,6 +1498,12 @@ Rails/Date:
|
|
1447
1498
|
- strict
|
1448
1499
|
- flexible
|
1449
1500
|
|
1501
|
+
Rails/Delegate:
|
1502
|
+
# When set to true, using the target object as a prefix of the
|
1503
|
+
# method name without using the `delegate` method will be a
|
1504
|
+
# violation. When set to false, this case is legal.
|
1505
|
+
EnforceForPrefixed: true
|
1506
|
+
|
1450
1507
|
Rails/DynamicFindBy:
|
1451
1508
|
Whitelist:
|
1452
1509
|
- find_by_sql
|
@@ -1475,6 +1532,10 @@ Rails/HasAndBelongsToMany:
|
|
1475
1532
|
Include:
|
1476
1533
|
- app/models/**/*.rb
|
1477
1534
|
|
1535
|
+
Rails/HasManyOrHasOneDependent:
|
1536
|
+
Include:
|
1537
|
+
- app/models/**/*.rb
|
1538
|
+
|
1478
1539
|
Rails/NotNullColumn:
|
1479
1540
|
Include:
|
1480
1541
|
- db/migrate/*.rb
|
data/config/disabled.yml
CHANGED
@@ -59,11 +59,6 @@ Style/DocumentationMethod:
|
|
59
59
|
- 'spec/**/*'
|
60
60
|
- 'test/**/*'
|
61
61
|
|
62
|
-
Style/Encoding:
|
63
|
-
Description: 'Use UTF-8 as the source file encoding.'
|
64
|
-
StyleGuide: '#utf-8'
|
65
|
-
Enabled: false
|
66
|
-
|
67
62
|
Style/ImplicitRuntimeError:
|
68
63
|
Description: >-
|
69
64
|
Use `raise` or `fail` with an explicit exception class and
|
@@ -105,6 +100,10 @@ Style/OptionHash:
|
|
105
100
|
Description: "Don't use option hashes when you can use keyword arguments."
|
106
101
|
Enabled: false
|
107
102
|
|
103
|
+
Style/ReturnNil:
|
104
|
+
Description: 'Use return instead of return nil.'
|
105
|
+
Enabled: false
|
106
|
+
|
108
107
|
Style/Send:
|
109
108
|
Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
|
110
109
|
StyleGuide: '#prefer-public-send'
|
data/config/enabled.yml
CHANGED
@@ -338,13 +338,69 @@ Layout/TrailingWhitespace:
|
|
338
338
|
StyleGuide: '#no-trailing-whitespace'
|
339
339
|
Enabled: true
|
340
340
|
|
341
|
-
####################
|
341
|
+
#################### Naming ##############################
|
342
342
|
|
343
|
-
|
343
|
+
Naming/AccessorMethodName:
|
344
344
|
Description: Check the naming of accessor methods for get_/set_.
|
345
345
|
StyleGuide: '#accessor_mutator_method_names'
|
346
346
|
Enabled: true
|
347
347
|
|
348
|
+
Naming/AsciiIdentifiers:
|
349
|
+
Description: 'Use only ascii symbols in identifiers.'
|
350
|
+
StyleGuide: '#english-identifiers'
|
351
|
+
Enabled: true
|
352
|
+
|
353
|
+
Naming/ClassAndModuleCamelCase:
|
354
|
+
Description: 'Use CamelCase for classes and modules.'
|
355
|
+
StyleGuide: '#camelcase-classes'
|
356
|
+
Enabled: true
|
357
|
+
|
358
|
+
Naming/ConstantName:
|
359
|
+
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
360
|
+
StyleGuide: '#screaming-snake-case'
|
361
|
+
Enabled: true
|
362
|
+
|
363
|
+
Naming/FileName:
|
364
|
+
Description: 'Use snake_case for source file names.'
|
365
|
+
StyleGuide: '#snake-case-files'
|
366
|
+
Enabled: true
|
367
|
+
|
368
|
+
Naming/HeredocDelimiterCase:
|
369
|
+
Description: 'Use configured case for heredoc delimiters.'
|
370
|
+
StyleGuide: '#heredoc-delimiters'
|
371
|
+
Enabled: true
|
372
|
+
|
373
|
+
Naming/HeredocDelimiterNaming:
|
374
|
+
Description: 'Use descriptive heredoc delimiters.'
|
375
|
+
StyleGuide: '#heredoc-delimiters'
|
376
|
+
Enabled: true
|
377
|
+
|
378
|
+
Naming/MethodName:
|
379
|
+
Description: 'Use the configured style when naming methods.'
|
380
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
381
|
+
Enabled: true
|
382
|
+
|
383
|
+
Naming/PredicateName:
|
384
|
+
Description: 'Check the names of predicate methods.'
|
385
|
+
StyleGuide: '#bool-methods-qmark'
|
386
|
+
Enabled: true
|
387
|
+
|
388
|
+
Naming/BinaryOperatorParameterName:
|
389
|
+
Description: 'When defining binary operators, name the argument other.'
|
390
|
+
StyleGuide: '#other-arg'
|
391
|
+
Enabled: true
|
392
|
+
|
393
|
+
Naming/VariableName:
|
394
|
+
Description: 'Use the configured style when naming variables.'
|
395
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
396
|
+
Enabled: true
|
397
|
+
|
398
|
+
Naming/VariableNumber:
|
399
|
+
Description: 'Use the configured style when numbering variables.'
|
400
|
+
Enabled: true
|
401
|
+
|
402
|
+
#################### Style ###############################
|
403
|
+
|
348
404
|
Style/Alias:
|
349
405
|
Description: 'Use alias instead of alias_method.'
|
350
406
|
StyleGuide: '#alias-method'
|
@@ -365,11 +421,6 @@ Style/AsciiComments:
|
|
365
421
|
StyleGuide: '#english-comments'
|
366
422
|
Enabled: true
|
367
423
|
|
368
|
-
Style/AsciiIdentifiers:
|
369
|
-
Description: 'Use only ascii symbols in identifiers.'
|
370
|
-
StyleGuide: '#english-identifiers'
|
371
|
-
Enabled: true
|
372
|
-
|
373
424
|
Style/Attr:
|
374
425
|
Description: 'Checks for uses of Module#attr.'
|
375
426
|
StyleGuide: '#attr'
|
@@ -412,13 +463,9 @@ Style/CharacterLiteral:
|
|
412
463
|
StyleGuide: '#no-character-literals'
|
413
464
|
Enabled: true
|
414
465
|
|
415
|
-
Style/ClassAndModuleCamelCase:
|
416
|
-
Description: 'Use CamelCase for classes and modules.'
|
417
|
-
StyleGuide: '#camelcase-classes'
|
418
|
-
Enabled: true
|
419
|
-
|
420
466
|
Style/ClassAndModuleChildren:
|
421
467
|
Description: 'Checks style of children classes and modules.'
|
468
|
+
StyleGuide: '#namespace-definition'
|
422
469
|
Enabled: true
|
423
470
|
|
424
471
|
Style/ClassCheck:
|
@@ -459,16 +506,17 @@ Style/ConditionalAssignment:
|
|
459
506
|
of assigning that variable inside of each branch.
|
460
507
|
Enabled: true
|
461
508
|
|
462
|
-
Style/ConstantName:
|
463
|
-
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
464
|
-
StyleGuide: '#screaming-snake-case'
|
465
|
-
Enabled: true
|
466
|
-
|
467
509
|
Style/DefWithParentheses:
|
468
510
|
Description: 'Use def with parentheses when there are arguments.'
|
469
511
|
StyleGuide: '#method-parens'
|
470
512
|
Enabled: true
|
471
513
|
|
514
|
+
Style/Dir:
|
515
|
+
Description: >-
|
516
|
+
Use the `__dir__` method to retrieve the canonicalized
|
517
|
+
absolute path to the current file.
|
518
|
+
Enabled: true
|
519
|
+
|
472
520
|
Style/Documentation:
|
473
521
|
Description: 'Document classes and non-namespace modules.'
|
474
522
|
Enabled: true
|
@@ -514,16 +562,16 @@ Style/EndBlock:
|
|
514
562
|
StyleGuide: '#no-END-blocks'
|
515
563
|
Enabled: true
|
516
564
|
|
565
|
+
Style/Encoding:
|
566
|
+
Description: 'Use UTF-8 as the source file encoding.'
|
567
|
+
StyleGuide: '#utf-8'
|
568
|
+
Enabled: true
|
569
|
+
|
517
570
|
Style/EvenOdd:
|
518
571
|
Description: 'Favor the use of Integer#even? && Integer#odd?'
|
519
572
|
StyleGuide: '#predicate-methods'
|
520
573
|
Enabled: true
|
521
574
|
|
522
|
-
Style/FileName:
|
523
|
-
Description: 'Use snake_case for source file names.'
|
524
|
-
StyleGuide: '#snake-case-files'
|
525
|
-
Enabled: true
|
526
|
-
|
527
575
|
Style/FrozenStringLiteralComment:
|
528
576
|
Description: >-
|
529
577
|
Add the frozen_string_literal comment to the top of files
|
@@ -634,16 +682,17 @@ Style/MethodDefParentheses:
|
|
634
682
|
StyleGuide: '#method-parens'
|
635
683
|
Enabled: true
|
636
684
|
|
637
|
-
Style/MethodName:
|
638
|
-
Description: 'Use the configured style when naming methods.'
|
639
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
640
|
-
Enabled: true
|
641
|
-
|
642
685
|
Style/MethodMissing:
|
643
686
|
Description: 'Avoid using `method_missing`.'
|
644
687
|
StyleGuide: '#no-method-missing'
|
645
688
|
Enabled: true
|
646
689
|
|
690
|
+
Style/MinMax:
|
691
|
+
Description: >-
|
692
|
+
Use `Enumerable#minmax` instead of `Enumerable#min`
|
693
|
+
and `Enumerable#max` in conjunction.'
|
694
|
+
Enabled: true
|
695
|
+
|
647
696
|
Style/MixinGrouping:
|
648
697
|
Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
|
649
698
|
StyleGuide: '#mixin-grouping'
|
@@ -768,11 +817,6 @@ Style/OneLineConditional:
|
|
768
817
|
StyleGuide: '#ternary-operator'
|
769
818
|
Enabled: true
|
770
819
|
|
771
|
-
Style/OpMethod:
|
772
|
-
Description: 'When defining binary operators, name the argument other.'
|
773
|
-
StyleGuide: '#other-arg'
|
774
|
-
Enabled: true
|
775
|
-
|
776
820
|
Style/OptionalArguments:
|
777
821
|
Description: >-
|
778
822
|
Checks for optional arguments that do not appear at the end
|
@@ -780,6 +824,11 @@ Style/OptionalArguments:
|
|
780
824
|
StyleGuide: '#optional-arguments'
|
781
825
|
Enabled: true
|
782
826
|
|
827
|
+
Style/OrAssignment:
|
828
|
+
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
829
|
+
StyleGuide: '#double-pipe-for-uninit'
|
830
|
+
Enabled: true
|
831
|
+
|
783
832
|
Style/ParallelAssignment:
|
784
833
|
Description: >-
|
785
834
|
Check for simple usages of parallel assignment.
|
@@ -809,11 +858,6 @@ Style/PerlBackrefs:
|
|
809
858
|
StyleGuide: '#no-perl-regexp-last-matchers'
|
810
859
|
Enabled: true
|
811
860
|
|
812
|
-
Style/PredicateName:
|
813
|
-
Description: 'Check the names of predicate methods.'
|
814
|
-
StyleGuide: '#bool-methods-qmark'
|
815
|
-
Enabled: true
|
816
|
-
|
817
861
|
Style/PreferredHashMethods:
|
818
862
|
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
819
863
|
StyleGuide: '#hash-key'
|
@@ -834,6 +878,10 @@ Style/RedundantBegin:
|
|
834
878
|
StyleGuide: '#begin-implicit'
|
835
879
|
Enabled: true
|
836
880
|
|
881
|
+
Style/RedundantConditional:
|
882
|
+
Description: "Don't return true/false from a conditional."
|
883
|
+
Enabled: true
|
884
|
+
|
837
885
|
Style/RedundantException:
|
838
886
|
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
839
887
|
StyleGuide: '#no-explicit-runtimeerror'
|
@@ -988,15 +1036,6 @@ Style/VariableInterpolation:
|
|
988
1036
|
StyleGuide: '#curlies-interpolate'
|
989
1037
|
Enabled: true
|
990
1038
|
|
991
|
-
Style/VariableName:
|
992
|
-
Description: 'Use the configured style when naming variables.'
|
993
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
994
|
-
Enabled: true
|
995
|
-
|
996
|
-
Style/VariableNumber:
|
997
|
-
Description: 'Use the configured style when numbering variables.'
|
998
|
-
Enabled: true
|
999
|
-
|
1000
1039
|
Style/WhenThen:
|
1001
1040
|
Description: 'Use when x then ... for one-line cases.'
|
1002
1041
|
StyleGuide: '#one-line-cases'
|
@@ -1113,6 +1152,10 @@ Lint/BlockAlignment:
|
|
1113
1152
|
Description: 'Align block ends correctly.'
|
1114
1153
|
Enabled: true
|
1115
1154
|
|
1155
|
+
Lint/BooleanSymbol:
|
1156
|
+
Description: 'Check for `:true` and `:false` symbols.'
|
1157
|
+
Enabled: true
|
1158
|
+
|
1116
1159
|
Lint/CircularArgumentReference:
|
1117
1160
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1118
1161
|
Enabled: true
|
@@ -1217,6 +1260,10 @@ Lint/InheritException:
|
|
1217
1260
|
Description: 'Avoid inheriting from the `Exception` class.'
|
1218
1261
|
Enabled: true
|
1219
1262
|
|
1263
|
+
Lint/InterpolationCheck:
|
1264
|
+
Description: 'Raise warning for interpolation in single q strs'
|
1265
|
+
Enabled: true
|
1266
|
+
|
1220
1267
|
Lint/InvalidCharacterLiteral:
|
1221
1268
|
Description: >-
|
1222
1269
|
Checks for invalid character literals with a non-escaped
|
@@ -1280,6 +1327,10 @@ Lint/RandOne:
|
|
1280
1327
|
and most likely a mistake.
|
1281
1328
|
Enabled: true
|
1282
1329
|
|
1330
|
+
Lint/RedundantWithIndex:
|
1331
|
+
Description: 'Checks for redundant `with_index`.'
|
1332
|
+
Enabled: true
|
1333
|
+
|
1283
1334
|
Lint/RequireParentheses:
|
1284
1335
|
Description: >-
|
1285
1336
|
Use parentheses in the method call to avoid confusion
|
@@ -1295,6 +1346,11 @@ Lint/RescueType:
|
|
1295
1346
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
1296
1347
|
Enabled: true
|
1297
1348
|
|
1349
|
+
Lint/RescueWithoutErrorClass:
|
1350
|
+
Description: 'Avoid rescuing without specifying an error class.'
|
1351
|
+
StyleGuide: '#no-blind-rescues'
|
1352
|
+
Enabled: true
|
1353
|
+
|
1298
1354
|
Lint/SafeNavigationChain:
|
1299
1355
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1300
1356
|
Enabled: true
|
@@ -1320,6 +1376,10 @@ Lint/StringConversionInInterpolation:
|
|
1320
1376
|
StyleGuide: '#no-to-s'
|
1321
1377
|
Enabled: true
|
1322
1378
|
|
1379
|
+
Lint/Syntax:
|
1380
|
+
Description: 'Checks syntax error'
|
1381
|
+
Enabled: true
|
1382
|
+
|
1323
1383
|
Lint/UnderscorePrefixedVariableName:
|
1324
1384
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
1325
1385
|
Enabled: true
|
@@ -1353,6 +1413,20 @@ Lint/UnreachableCode:
|
|
1353
1413
|
Description: 'Unreachable code.'
|
1354
1414
|
Enabled: true
|
1355
1415
|
|
1416
|
+
Lint/UriEscapeUnescape:
|
1417
|
+
Description: >-
|
1418
|
+
`URI.escape` method is obsolete and should not be used. Instead, use
|
1419
|
+
`CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
|
1420
|
+
depending on your specific use case.
|
1421
|
+
Also `URI.unescape` method is obsolete and should not be used. Instead, use
|
1422
|
+
`CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
|
1423
|
+
depending on your specific use case.
|
1424
|
+
Enabled: true
|
1425
|
+
|
1426
|
+
Lint/UriRegexp:
|
1427
|
+
Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
|
1428
|
+
Enabled: true
|
1429
|
+
|
1356
1430
|
Lint/UselessAccessModifier:
|
1357
1431
|
Description: 'Checks for useless access modifiers.'
|
1358
1432
|
Enabled: true
|
@@ -1372,6 +1446,10 @@ Lint/UselessElseWithoutRescue:
|
|
1372
1446
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1373
1447
|
Enabled: true
|
1374
1448
|
|
1449
|
+
Lint/ReturnInVoidContext:
|
1450
|
+
Description: 'Checks for return in void context.'
|
1451
|
+
Enabled: true
|
1452
|
+
|
1375
1453
|
Lint/UselessSetterCall:
|
1376
1454
|
Description: 'Checks for useless setter call to a local variable.'
|
1377
1455
|
Enabled: true
|
@@ -1518,7 +1596,7 @@ Performance/Size:
|
|
1518
1596
|
Enabled: true
|
1519
1597
|
|
1520
1598
|
Performance/CompareWithBlock:
|
1521
|
-
Description: 'Use `sort_by(&:foo)` instead of `
|
1599
|
+
Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
|
1522
1600
|
Enabled: true
|
1523
1601
|
|
1524
1602
|
Performance/StartWith:
|
@@ -1540,6 +1618,15 @@ Performance/StringReplacement:
|
|
1540
1618
|
|
1541
1619
|
Performance/TimesMap:
|
1542
1620
|
Description: 'Checks for .times.map calls.'
|
1621
|
+
AutoCorrect: false
|
1622
|
+
Enabled: true
|
1623
|
+
|
1624
|
+
Performance/UnfreezeString:
|
1625
|
+
Description: 'Use unary plus to get an unfrozen string literal.'
|
1626
|
+
Enabled: true
|
1627
|
+
|
1628
|
+
Performance/UriDefaultParser:
|
1629
|
+
Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
|
1543
1630
|
Enabled: true
|
1544
1631
|
|
1545
1632
|
#################### Rails #################################
|
@@ -1622,6 +1709,11 @@ Rails/HasAndBelongsToMany:
|
|
1622
1709
|
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
|
1623
1710
|
Enabled: true
|
1624
1711
|
|
1712
|
+
Rails/HasManyOrHasOneDependent:
|
1713
|
+
Description: 'Define the dependent option to the has_many and has_one associations.'
|
1714
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has_many-has_one-dependent-option'
|
1715
|
+
Enabled: true
|
1716
|
+
|
1625
1717
|
Rails/HttpPositionalArguments:
|
1626
1718
|
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
|
1627
1719
|
Enabled: true
|
@@ -1744,6 +1836,16 @@ Bundler/DuplicatedGem:
|
|
1744
1836
|
- '**/Gemfile'
|
1745
1837
|
- '**/gems.rb'
|
1746
1838
|
|
1839
|
+
Bundler/InsecureProtocolSource:
|
1840
|
+
Description: >-
|
1841
|
+
The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
|
1842
|
+
because HTTP requests are insecure. Please change your source to
|
1843
|
+
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
1844
|
+
Enabled: true
|
1845
|
+
Include:
|
1846
|
+
- '**/Gemfile'
|
1847
|
+
- '**/gems.rb'
|
1848
|
+
|
1747
1849
|
Bundler/OrderedGems:
|
1748
1850
|
Description: >-
|
1749
1851
|
Gems within groups in the Gemfile should be alphabetically sorted.
|