rubocop 1.6.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +3 -2
  4. data/config/default.yml +142 -19
  5. data/lib/rubocop.rb +15 -1
  6. data/lib/rubocop/cli/command/auto_genenerate_config.rb +5 -4
  7. data/lib/rubocop/comment_config.rb +6 -6
  8. data/lib/rubocop/config.rb +10 -7
  9. data/lib/rubocop/config_loader.rb +11 -14
  10. data/lib/rubocop/config_loader_resolver.rb +21 -4
  11. data/lib/rubocop/config_obsoletion.rb +5 -3
  12. data/lib/rubocop/config_obsoletion/extracted_cop.rb +6 -6
  13. data/lib/rubocop/config_store.rb +12 -1
  14. data/lib/rubocop/cop/base.rb +1 -1
  15. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +3 -2
  16. data/lib/rubocop/cop/generator.rb +1 -3
  17. data/lib/rubocop/cop/internal_affairs.rb +6 -1
  18. data/lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb +68 -0
  19. data/lib/rubocop/cop/internal_affairs/example_description.rb +89 -0
  20. data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +61 -0
  21. data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +64 -0
  22. data/lib/rubocop/cop/internal_affairs/style_detected_api_use.rb +145 -0
  23. data/lib/rubocop/cop/layout/class_structure.rb +7 -2
  24. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +19 -3
  25. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +14 -0
  26. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +2 -2
  27. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +3 -10
  28. data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +1 -0
  29. data/lib/rubocop/cop/layout/space_before_block_braces.rb +2 -0
  30. data/lib/rubocop/cop/layout/space_before_brackets.rb +62 -0
  31. data/lib/rubocop/cop/layout/space_inside_block_braces.rb +13 -10
  32. data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -2
  33. data/lib/rubocop/cop/lint/ambiguous_assignment.rb +59 -0
  34. data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +7 -2
  35. data/lib/rubocop/cop/lint/deprecated_constants.rb +75 -0
  36. data/lib/rubocop/cop/lint/duplicate_branch.rb +64 -2
  37. data/lib/rubocop/cop/lint/lambda_without_literal_block.rb +44 -0
  38. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +10 -6
  39. data/lib/rubocop/cop/lint/number_conversion.rb +41 -6
  40. data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +47 -0
  41. data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +39 -0
  42. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +2 -1
  43. data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +50 -0
  44. data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +50 -17
  45. data/lib/rubocop/cop/lint/shadowed_exception.rb +1 -11
  46. data/lib/rubocop/cop/lint/symbol_conversion.rb +102 -0
  47. data/lib/rubocop/cop/lint/triple_quotes.rb +71 -0
  48. data/lib/rubocop/cop/lint/unreachable_loop.rb +17 -0
  49. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
  50. data/lib/rubocop/cop/mixin/allowed_identifiers.rb +18 -0
  51. data/lib/rubocop/cop/mixin/check_line_breakable.rb +5 -0
  52. data/lib/rubocop/cop/mixin/comments_help.rb +1 -11
  53. data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
  54. data/lib/rubocop/cop/mixin/uncommunicative_name.rb +5 -1
  55. data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +59 -5
  56. data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +38 -5
  57. data/lib/rubocop/cop/naming/variable_name.rb +2 -0
  58. data/lib/rubocop/cop/naming/variable_number.rb +2 -9
  59. data/lib/rubocop/cop/registry.rb +10 -0
  60. data/lib/rubocop/cop/severity.rb +3 -3
  61. data/lib/rubocop/cop/style/access_modifier_declarations.rb +3 -1
  62. data/lib/rubocop/cop/style/ascii_comments.rb +1 -1
  63. data/lib/rubocop/cop/style/collection_methods.rb +14 -1
  64. data/lib/rubocop/cop/style/commented_keyword.rb +22 -5
  65. data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -9
  66. data/lib/rubocop/cop/style/empty_literal.rb +6 -2
  67. data/lib/rubocop/cop/style/endless_method.rb +102 -0
  68. data/lib/rubocop/cop/style/eval_with_location.rb +63 -34
  69. data/lib/rubocop/cop/style/explicit_block_argument.rb +10 -0
  70. data/lib/rubocop/cop/style/float_division.rb +3 -0
  71. data/lib/rubocop/cop/style/for.rb +2 -0
  72. data/lib/rubocop/cop/style/format_string_token.rb +18 -2
  73. data/lib/rubocop/cop/style/hash_except.rb +95 -0
  74. data/lib/rubocop/cop/style/hash_like_case.rb +2 -1
  75. data/lib/rubocop/cop/style/if_inside_else.rb +22 -10
  76. data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +96 -0
  77. data/lib/rubocop/cop/style/keyword_parameters_order.rb +12 -2
  78. data/lib/rubocop/cop/style/lambda_call.rb +2 -1
  79. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +7 -0
  80. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +16 -6
  81. data/lib/rubocop/cop/style/method_def_parentheses.rb +7 -0
  82. data/lib/rubocop/cop/style/multiline_method_signature.rb +26 -1
  83. data/lib/rubocop/cop/style/multiline_when_then.rb +3 -1
  84. data/lib/rubocop/cop/style/mutable_constant.rb +13 -3
  85. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +4 -0
  86. data/lib/rubocop/cop/style/nil_comparison.rb +1 -0
  87. data/lib/rubocop/cop/style/non_nil_check.rb +23 -13
  88. data/lib/rubocop/cop/style/raise_args.rb +5 -2
  89. data/lib/rubocop/cop/style/redundant_argument.rb +7 -1
  90. data/lib/rubocop/cop/style/redundant_freeze.rb +8 -4
  91. data/lib/rubocop/cop/style/redundant_return.rb +1 -1
  92. data/lib/rubocop/cop/style/single_line_methods.rb +34 -2
  93. data/lib/rubocop/cop/style/sole_nested_conditional.rb +29 -5
  94. data/lib/rubocop/cop/style/string_concatenation.rb +1 -1
  95. data/lib/rubocop/cop/style/symbol_proc.rb +5 -4
  96. data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
  97. data/lib/rubocop/cop/style/while_until_modifier.rb +2 -4
  98. data/lib/rubocop/cop/util.rb +3 -1
  99. data/lib/rubocop/formatter/git_hub_actions_formatter.rb +1 -0
  100. data/lib/rubocop/magic_comment.rb +30 -1
  101. data/lib/rubocop/options.rb +10 -10
  102. data/lib/rubocop/rspec/cop_helper.rb +0 -4
  103. data/lib/rubocop/rspec/expect_offense.rb +37 -22
  104. data/lib/rubocop/runner.rb +17 -1
  105. data/lib/rubocop/target_finder.rb +4 -2
  106. data/lib/rubocop/target_ruby.rb +47 -11
  107. data/lib/rubocop/util.rb +16 -0
  108. data/lib/rubocop/version.rb +8 -2
  109. metadata +26 -7
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.6.0'
6
+ STRING = '1.9.0'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, '\
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
@@ -34,7 +34,13 @@ module RuboCop
34
34
 
35
35
  # @api private
36
36
  def self.extension_versions(env)
37
- env.config_store.for_pwd.loaded_features.sort.map do |loaded_feature|
37
+ features = Util.silence_warnings do
38
+ # Suppress any config issues when loading the config (ie. deprecations,
39
+ # pending cops, etc.).
40
+ env.config_store.unvalidated.for_pwd.loaded_features.sort
41
+ end
42
+
43
+ features.map do |loaded_feature|
38
44
  next unless (match = loaded_feature.match(/rubocop-(?<feature>.*)/))
39
45
 
40
46
  feature = match[:feature]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-12-09 00:00:00.000000000 Z
13
+ date: 2021-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: 2.7.1.5
35
+ version: 3.0.0.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 2.7.1.5
42
+ version: 3.0.0.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rainbow
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: 1.4.0
138
138
  - - "<"
139
139
  - !ruby/object:Gem::Version
140
- version: '2.0'
140
+ version: '3.0'
141
141
  type: :runtime
142
142
  prerelease: false
143
143
  version_requirements: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ dependencies:
147
147
  version: 1.4.0
148
148
  - - "<"
149
149
  - !ruby/object:Gem::Version
150
- version: '2.0'
150
+ version: '3.0'
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: bundler
153
153
  requirement: !ruby/object:Gem::Requirement
@@ -252,12 +252,17 @@ files:
252
252
  - lib/rubocop/cop/generator/require_file_injector.rb
253
253
  - lib/rubocop/cop/ignored_node.rb
254
254
  - lib/rubocop/cop/internal_affairs.rb
255
+ - lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb
256
+ - lib/rubocop/cop/internal_affairs/example_description.rb
255
257
  - lib/rubocop/cop/internal_affairs/method_name_equal.rb
256
258
  - lib/rubocop/cop/internal_affairs/node_destructuring.rb
257
259
  - lib/rubocop/cop/internal_affairs/node_type_predicate.rb
258
260
  - lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
261
+ - lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb
262
+ - lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb
259
263
  - lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
260
264
  - lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
265
+ - lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
261
266
  - lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
262
267
  - lib/rubocop/cop/layout/access_modifier_indentation.rb
263
268
  - lib/rubocop/cop/layout/argument_alignment.rb
@@ -335,6 +340,7 @@ files:
335
340
  - lib/rubocop/cop/layout/space_around_method_call_operator.rb
336
341
  - lib/rubocop/cop/layout/space_around_operators.rb
337
342
  - lib/rubocop/cop/layout/space_before_block_braces.rb
343
+ - lib/rubocop/cop/layout/space_before_brackets.rb
338
344
  - lib/rubocop/cop/layout/space_before_comma.rb
339
345
  - lib/rubocop/cop/layout/space_before_comment.rb
340
346
  - lib/rubocop/cop/layout/space_before_first_arg.rb
@@ -353,6 +359,7 @@ files:
353
359
  - lib/rubocop/cop/layout/trailing_whitespace.rb
354
360
  - lib/rubocop/cop/legacy/corrections_proxy.rb
355
361
  - lib/rubocop/cop/legacy/corrector.rb
362
+ - lib/rubocop/cop/lint/ambiguous_assignment.rb
356
363
  - lib/rubocop/cop/lint/ambiguous_block_association.rb
357
364
  - lib/rubocop/cop/lint/ambiguous_operator.rb
358
365
  - lib/rubocop/cop/lint/ambiguous_regexp_literal.rb
@@ -365,6 +372,7 @@ files:
365
372
  - lib/rubocop/cop/lint/constant_resolution.rb
366
373
  - lib/rubocop/cop/lint/debugger.rb
367
374
  - lib/rubocop/cop/lint/deprecated_class_methods.rb
375
+ - lib/rubocop/cop/lint/deprecated_constants.rb
368
376
  - lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
369
377
  - lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
370
378
  - lib/rubocop/cop/lint/duplicate_branch.rb
@@ -398,6 +406,7 @@ files:
398
406
  - lib/rubocop/cop/lint/ineffective_access_modifier.rb
399
407
  - lib/rubocop/cop/lint/inherit_exception.rb
400
408
  - lib/rubocop/cop/lint/interpolation_check.rb
409
+ - lib/rubocop/cop/lint/lambda_without_literal_block.rb
401
410
  - lib/rubocop/cop/lint/literal_as_condition.rb
402
411
  - lib/rubocop/cop/lint/literal_in_interpolation.rb
403
412
  - lib/rubocop/cop/lint/loop.rb
@@ -412,6 +421,8 @@ files:
412
421
  - lib/rubocop/cop/lint/non_deterministic_require_order.rb
413
422
  - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
414
423
  - lib/rubocop/cop/lint/number_conversion.rb
424
+ - lib/rubocop/cop/lint/numbered_parameter_assignment.rb
425
+ - lib/rubocop/cop/lint/or_assignment_to_constant.rb
415
426
  - lib/rubocop/cop/lint/ordered_magic_comments.rb
416
427
  - lib/rubocop/cop/lint/out_of_range_regexp_ref.rb
417
428
  - lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
@@ -421,6 +432,7 @@ files:
421
432
  - lib/rubocop/cop/lint/rand_one.rb
422
433
  - lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
423
434
  - lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
435
+ - lib/rubocop/cop/lint/redundant_dir_glob_sort.rb
424
436
  - lib/rubocop/cop/lint/redundant_require_statement.rb
425
437
  - lib/rubocop/cop/lint/redundant_safe_navigation.rb
426
438
  - lib/rubocop/cop/lint/redundant_splat_expansion.rb
@@ -443,11 +455,13 @@ files:
443
455
  - lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
444
456
  - lib/rubocop/cop/lint/struct_new_override.rb
445
457
  - lib/rubocop/cop/lint/suppressed_exception.rb
458
+ - lib/rubocop/cop/lint/symbol_conversion.rb
446
459
  - lib/rubocop/cop/lint/syntax.rb
447
460
  - lib/rubocop/cop/lint/to_enum_arguments.rb
448
461
  - lib/rubocop/cop/lint/to_json.rb
449
462
  - lib/rubocop/cop/lint/top_level_return_with_argument.rb
450
463
  - lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb
464
+ - lib/rubocop/cop/lint/triple_quotes.rb
451
465
  - lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
452
466
  - lib/rubocop/cop/lint/unexpected_block_arity.rb
453
467
  - lib/rubocop/cop/lint/unified_integer.rb
@@ -482,6 +496,7 @@ files:
482
496
  - lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb
483
497
  - lib/rubocop/cop/migration/department_name.rb
484
498
  - lib/rubocop/cop/mixin/alignment.rb
499
+ - lib/rubocop/cop/mixin/allowed_identifiers.rb
485
500
  - lib/rubocop/cop/mixin/allowed_methods.rb
486
501
  - lib/rubocop/cop/mixin/annotation_comment.rb
487
502
  - lib/rubocop/cop/mixin/array_min_size.rb
@@ -624,6 +639,7 @@ files:
624
639
  - lib/rubocop/cop/style/empty_method.rb
625
640
  - lib/rubocop/cop/style/encoding.rb
626
641
  - lib/rubocop/cop/style/end_block.rb
642
+ - lib/rubocop/cop/style/endless_method.rb
627
643
  - lib/rubocop/cop/style/eval_with_location.rb
628
644
  - lib/rubocop/cop/style/even_odd.rb
629
645
  - lib/rubocop/cop/style/expand_path_arguments.rb
@@ -639,6 +655,7 @@ files:
639
655
  - lib/rubocop/cop/style/guard_clause.rb
640
656
  - lib/rubocop/cop/style/hash_as_last_array_item.rb
641
657
  - lib/rubocop/cop/style/hash_each_methods.rb
658
+ - lib/rubocop/cop/style/hash_except.rb
642
659
  - lib/rubocop/cop/style/hash_like_case.rb
643
660
  - lib/rubocop/cop/style/hash_syntax.rb
644
661
  - lib/rubocop/cop/style/hash_transform_keys.rb
@@ -647,6 +664,7 @@ files:
647
664
  - lib/rubocop/cop/style/if_inside_else.rb
648
665
  - lib/rubocop/cop/style/if_unless_modifier.rb
649
666
  - lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb
667
+ - lib/rubocop/cop/style/if_with_boolean_literal_branches.rb
650
668
  - lib/rubocop/cop/style/if_with_semicolon.rb
651
669
  - lib/rubocop/cop/style/implicit_runtime_error.rb
652
670
  - lib/rubocop/cop/style/infinite_loop.rb
@@ -836,6 +854,7 @@ files:
836
854
  - lib/rubocop/string_interpreter.rb
837
855
  - lib/rubocop/target_finder.rb
838
856
  - lib/rubocop/target_ruby.rb
857
+ - lib/rubocop/util.rb
839
858
  - lib/rubocop/version.rb
840
859
  - lib/rubocop/warning.rb
841
860
  - lib/rubocop/yaml_duplication_checker.rb
@@ -846,7 +865,7 @@ metadata:
846
865
  homepage_uri: https://rubocop.org/
847
866
  changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
848
867
  source_code_uri: https://github.com/rubocop-hq/rubocop/
849
- documentation_uri: https://docs.rubocop.org/rubocop/1.6/
868
+ documentation_uri: https://docs.rubocop.org/rubocop/1.9/
850
869
  bug_tracker_uri: https://github.com/rubocop-hq/rubocop/issues
851
870
  post_install_message:
852
871
  rdoc_options: []