rubocop 1.22.0 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +43 -7
  4. data/lib/rubocop/config_loader.rb +1 -1
  5. data/lib/rubocop/cop/bundler/gem_comment.rb +3 -3
  6. data/lib/rubocop/cop/gemspec/date_assignment.rb +2 -10
  7. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +1 -10
  8. data/lib/rubocop/cop/gemspec/require_mfa.rb +146 -0
  9. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +30 -23
  10. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +3 -10
  11. data/lib/rubocop/cop/generator.rb +1 -1
  12. data/lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb +60 -0
  13. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  14. data/lib/rubocop/cop/layout/assignment_indentation.rb +1 -1
  15. data/lib/rubocop/cop/layout/block_alignment.rb +3 -3
  16. data/lib/rubocop/cop/layout/dot_position.rb +10 -4
  17. data/lib/rubocop/cop/layout/empty_comment.rb +1 -1
  18. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +22 -1
  19. data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +7 -4
  20. data/lib/rubocop/cop/layout/end_alignment.rb +1 -2
  21. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +1 -1
  22. data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +1 -1
  23. data/lib/rubocop/cop/layout/first_parameter_indentation.rb +1 -1
  24. data/lib/rubocop/cop/layout/hash_alignment.rb +1 -1
  25. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
  26. data/lib/rubocop/cop/layout/indentation_width.rb +1 -1
  27. data/lib/rubocop/cop/layout/line_length.rb +1 -1
  28. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
  29. data/lib/rubocop/cop/layout/multiline_block_layout.rb +2 -2
  30. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
  31. data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +1 -1
  32. data/lib/rubocop/cop/layout/space_before_comment.rb +1 -1
  33. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +11 -5
  34. data/lib/rubocop/cop/layout/space_inside_parens.rb +0 -4
  35. data/lib/rubocop/cop/lint/ambiguous_range.rb +3 -3
  36. data/lib/rubocop/cop/lint/deprecated_constants.rb +3 -2
  37. data/lib/rubocop/cop/lint/else_layout.rb +1 -1
  38. data/lib/rubocop/cop/lint/number_conversion.rb +5 -2
  39. data/lib/rubocop/cop/lint/require_relative_self_path.rb +1 -0
  40. data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +117 -0
  41. data/lib/rubocop/cop/metrics/parameter_lists.rb +5 -2
  42. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -2
  43. data/lib/rubocop/cop/mixin/gemspec_help.rb +30 -0
  44. data/lib/rubocop/cop/mixin/hash_transform_method.rb +3 -3
  45. data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +1 -1
  46. data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +1 -1
  47. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +1 -1
  48. data/lib/rubocop/cop/mixin/space_before_punctuation.rb +1 -1
  49. data/lib/rubocop/cop/mixin/statement_modifier.rb +1 -1
  50. data/lib/rubocop/cop/mixin/trailing_body.rb +1 -1
  51. data/lib/rubocop/cop/naming/file_name.rb +37 -4
  52. data/lib/rubocop/cop/security/json_load.rb +1 -1
  53. data/lib/rubocop/cop/style/commented_keyword.rb +5 -3
  54. data/lib/rubocop/cop/style/documentation.rb +1 -1
  55. data/lib/rubocop/cop/style/empty_method.rb +1 -1
  56. data/lib/rubocop/cop/style/format_string_token.rb +2 -1
  57. data/lib/rubocop/cop/style/line_end_concatenation.rb +1 -1
  58. data/lib/rubocop/cop/style/multiline_in_pattern_then.rb +1 -1
  59. data/lib/rubocop/cop/style/multiline_when_then.rb +1 -1
  60. data/lib/rubocop/cop/style/open_struct_use.rb +69 -0
  61. data/lib/rubocop/cop/style/parentheses_around_condition.rb +12 -2
  62. data/lib/rubocop/cop/style/quoted_symbols.rb +21 -7
  63. data/lib/rubocop/cop/style/redundant_argument.rb +5 -2
  64. data/lib/rubocop/cop/style/select_by_regexp.rb +39 -6
  65. data/lib/rubocop/cop/util.rb +13 -2
  66. data/lib/rubocop/formatter/html_formatter.rb +5 -2
  67. data/lib/rubocop/formatter/json_formatter.rb +4 -1
  68. data/lib/rubocop/rake_task.rb +1 -1
  69. data/lib/rubocop/remote_config.rb +1 -1
  70. data/lib/rubocop/result_cache.rb +2 -2
  71. data/lib/rubocop/rspec/parallel_formatter.rb +90 -0
  72. data/lib/rubocop/rspec/support.rb +1 -0
  73. data/lib/rubocop/runner.rb +1 -1
  74. data/lib/rubocop/target_finder.rb +1 -1
  75. data/lib/rubocop/version.rb +1 -1
  76. data/lib/rubocop/yaml_duplication_checker.rb +1 -1
  77. data/lib/rubocop.rb +4 -0
  78. metadata +10 -3
@@ -6,6 +6,7 @@ require_relative 'cop_helper'
6
6
  require_relative 'host_environment_simulation_helper'
7
7
  require_relative 'shared_contexts'
8
8
  require_relative 'expect_offense'
9
+ require_relative 'parallel_formatter'
9
10
 
10
11
  RSpec.configure do |config|
11
12
  config.include CopHelper
@@ -60,7 +60,7 @@ module RuboCop
60
60
 
61
61
  private
62
62
 
63
- # Warms up the RuboCop cache by forking a suitable number of rubocop
63
+ # Warms up the RuboCop cache by forking a suitable number of RuboCop
64
64
  # instances that each inspects its allotted group of files.
65
65
  def warm_cache(target_files)
66
66
  puts 'Running parallel inspection' if @options[:debug]
@@ -95,7 +95,7 @@ module RuboCop
95
95
 
96
96
  def wanted_dir_patterns(base_dir, exclude_pattern, flags)
97
97
  base_dir = base_dir.gsub('/{}/', '/\{}/')
98
- dirs = Dir.glob(File.join(base_dir.gsub('/**/', '/\**/'), '*/'), flags)
98
+ dirs = Dir.glob(File.join(base_dir.gsub('/*/', '/\*/').gsub('/**/', '/\**/'), '*/'), flags)
99
99
  .reject do |dir|
100
100
  next true if dir.end_with?('/./', '/../')
101
101
  next true if File.fnmatch?(exclude_pattern, dir, flags)
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.22.0'
6
+ STRING = '1.23.0'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, '\
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
@@ -23,7 +23,7 @@ module RuboCop
23
23
  when Psych::Nodes::Mapping
24
24
  tree.children.each_slice(2).with_object([]) do |(key, value), keys|
25
25
  exist = keys.find { |key2| key2.value == key.value }
26
- on_duplicated.call(exist, key) if exist
26
+ yield(exist, key) if exist
27
27
  keys << key
28
28
  traverse(value, &on_duplicated)
29
29
  end
data/lib/rubocop.rb CHANGED
@@ -83,6 +83,7 @@ require_relative 'rubocop/cop/mixin/enforce_superclass'
83
83
  require_relative 'rubocop/cop/mixin/first_element_line_break'
84
84
  require_relative 'rubocop/cop/mixin/frozen_string_literal'
85
85
  require_relative 'rubocop/cop/mixin/gem_declaration'
86
+ require_relative 'rubocop/cop/mixin/gemspec_help'
86
87
  require_relative 'rubocop/cop/mixin/hash_alignment_styles'
87
88
  require_relative 'rubocop/cop/mixin/hash_transform_method'
88
89
  require_relative 'rubocop/cop/mixin/ignored_pattern'
@@ -160,6 +161,7 @@ require_relative 'rubocop/cop/bundler/ordered_gems'
160
161
  require_relative 'rubocop/cop/gemspec/date_assignment'
161
162
  require_relative 'rubocop/cop/gemspec/duplicated_assignment'
162
163
  require_relative 'rubocop/cop/gemspec/ordered_dependencies'
164
+ require_relative 'rubocop/cop/gemspec/require_mfa'
163
165
  require_relative 'rubocop/cop/gemspec/required_ruby_version'
164
166
  require_relative 'rubocop/cop/gemspec/ruby_version_globals_usage'
165
167
 
@@ -382,6 +384,7 @@ require_relative 'rubocop/cop/lint/useless_access_modifier'
382
384
  require_relative 'rubocop/cop/lint/useless_assignment'
383
385
  require_relative 'rubocop/cop/lint/useless_else_without_rescue'
384
386
  require_relative 'rubocop/cop/lint/useless_method_definition'
387
+ require_relative 'rubocop/cop/lint/useless_ruby2_keywords'
385
388
  require_relative 'rubocop/cop/lint/useless_setter_call'
386
389
  require_relative 'rubocop/cop/lint/useless_times'
387
390
  require_relative 'rubocop/cop/lint/void'
@@ -514,6 +517,7 @@ require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
514
517
  require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
515
518
  require_relative 'rubocop/cop/style/multiline_in_pattern_then'
516
519
  require_relative 'rubocop/cop/style/numbered_parameters'
520
+ require_relative 'rubocop/cop/style/open_struct_use'
517
521
  require_relative 'rubocop/cop/style/redundant_assignment'
518
522
  require_relative 'rubocop/cop/style/redundant_fetch_block'
519
523
  require_relative 'rubocop/cop/style/redundant_file_extension_in_require'
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.22.0
4
+ version: 1.23.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: 2021-09-29 00:00:00.000000000 Z
13
+ date: 2021-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -250,6 +250,7 @@ files:
250
250
  - lib/rubocop/cop/gemspec/date_assignment.rb
251
251
  - lib/rubocop/cop/gemspec/duplicated_assignment.rb
252
252
  - lib/rubocop/cop/gemspec/ordered_dependencies.rb
253
+ - lib/rubocop/cop/gemspec/require_mfa.rb
253
254
  - lib/rubocop/cop/gemspec/required_ruby_version.rb
254
255
  - lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb
255
256
  - lib/rubocop/cop/generator.rb
@@ -260,6 +261,7 @@ files:
260
261
  - lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb
261
262
  - lib/rubocop/cop/internal_affairs/example_description.rb
262
263
  - lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb
264
+ - lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb
263
265
  - lib/rubocop/cop/internal_affairs/method_name_equal.rb
264
266
  - lib/rubocop/cop/internal_affairs/node_destructuring.rb
265
267
  - lib/rubocop/cop/internal_affairs/node_matcher_directive.rb
@@ -492,6 +494,7 @@ files:
492
494
  - lib/rubocop/cop/lint/useless_assignment.rb
493
495
  - lib/rubocop/cop/lint/useless_else_without_rescue.rb
494
496
  - lib/rubocop/cop/lint/useless_method_definition.rb
497
+ - lib/rubocop/cop/lint/useless_ruby2_keywords.rb
495
498
  - lib/rubocop/cop/lint/useless_setter_call.rb
496
499
  - lib/rubocop/cop/lint/useless_times.rb
497
500
  - lib/rubocop/cop/lint/void.rb
@@ -537,6 +540,7 @@ files:
537
540
  - lib/rubocop/cop/mixin/first_element_line_break.rb
538
541
  - lib/rubocop/cop/mixin/frozen_string_literal.rb
539
542
  - lib/rubocop/cop/mixin/gem_declaration.rb
543
+ - lib/rubocop/cop/mixin/gemspec_help.rb
540
544
  - lib/rubocop/cop/mixin/hash_alignment_styles.rb
541
545
  - lib/rubocop/cop/mixin/hash_transform_method.rb
542
546
  - lib/rubocop/cop/mixin/heredoc.rb
@@ -739,6 +743,7 @@ files:
739
743
  - lib/rubocop/cop/style/numeric_literals.rb
740
744
  - lib/rubocop/cop/style/numeric_predicate.rb
741
745
  - lib/rubocop/cop/style/one_line_conditional.rb
746
+ - lib/rubocop/cop/style/open_struct_use.rb
742
747
  - lib/rubocop/cop/style/option_hash.rb
743
748
  - lib/rubocop/cop/style/optional_arguments.rb
744
749
  - lib/rubocop/cop/style/optional_boolean_parameter.rb
@@ -880,6 +885,7 @@ files:
880
885
  - lib/rubocop/rspec/cop_helper.rb
881
886
  - lib/rubocop/rspec/expect_offense.rb
882
887
  - lib/rubocop/rspec/host_environment_simulation_helper.rb
888
+ - lib/rubocop/rspec/parallel_formatter.rb
883
889
  - lib/rubocop/rspec/shared_contexts.rb
884
890
  - lib/rubocop/rspec/support.rb
885
891
  - lib/rubocop/runner.rb
@@ -897,8 +903,9 @@ metadata:
897
903
  homepage_uri: https://rubocop.org/
898
904
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
899
905
  source_code_uri: https://github.com/rubocop/rubocop/
900
- documentation_uri: https://docs.rubocop.org/rubocop/1.22/
906
+ documentation_uri: https://docs.rubocop.org/rubocop/1.23/
901
907
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
908
+ rubygems_mfa_required: 'true'
902
909
  post_install_message:
903
910
  rdoc_options: []
904
911
  require_paths: