rubocop 1.76.2 → 1.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +23 -1
  4. data/lib/rubocop/cli.rb +12 -1
  5. data/lib/rubocop/config_loader.rb +1 -38
  6. data/lib/rubocop/cop/correctors/parentheses_corrector.rb +5 -2
  7. data/lib/rubocop/cop/gemspec/attribute_assignment.rb +91 -0
  8. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +0 -22
  9. data/lib/rubocop/cop/gemspec/require_mfa.rb +15 -1
  10. data/lib/rubocop/cop/internal_affairs/example_description.rb +1 -1
  11. data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +4 -4
  12. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
  13. data/lib/rubocop/cop/layout/line_length.rb +26 -5
  14. data/lib/rubocop/cop/layout/space_before_brackets.rb +2 -9
  15. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +7 -2
  16. data/lib/rubocop/cop/lint/duplicate_methods.rb +25 -4
  17. data/lib/rubocop/cop/lint/float_comparison.rb +4 -4
  18. data/lib/rubocop/cop/lint/literal_as_condition.rb +5 -3
  19. data/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +1 -1
  20. data/lib/rubocop/cop/lint/redundant_type_conversion.rb +4 -4
  21. data/lib/rubocop/cop/lint/self_assignment.rb +25 -0
  22. data/lib/rubocop/cop/lint/useless_access_modifier.rb +8 -0
  23. data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +3 -3
  24. data/lib/rubocop/cop/mixin/alignment.rb +1 -1
  25. data/lib/rubocop/cop/mixin/gemspec_help.rb +22 -0
  26. data/lib/rubocop/cop/mixin/line_length_help.rb +24 -8
  27. data/lib/rubocop/cop/naming/file_name.rb +2 -2
  28. data/lib/rubocop/cop/naming/method_name.rb +87 -12
  29. data/lib/rubocop/cop/naming/predicate_method.rb +64 -6
  30. data/lib/rubocop/cop/naming/predicate_prefix.rb +2 -2
  31. data/lib/rubocop/cop/security/eval.rb +2 -1
  32. data/lib/rubocop/cop/security/open.rb +1 -0
  33. data/lib/rubocop/cop/style/case_like_if.rb +1 -1
  34. data/lib/rubocop/cop/style/collection_querying.rb +167 -0
  35. data/lib/rubocop/cop/style/exponential_notation.rb +2 -2
  36. data/lib/rubocop/cop/style/fetch_env_var.rb +32 -6
  37. data/lib/rubocop/cop/style/hash_conversion.rb +16 -8
  38. data/lib/rubocop/cop/style/if_unless_modifier.rb +11 -2
  39. data/lib/rubocop/cop/style/it_block_parameter.rb +1 -1
  40. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +1 -1
  41. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +16 -0
  42. data/lib/rubocop/cop/style/redundant_fetch_block.rb +1 -9
  43. data/lib/rubocop/cop/style/redundant_interpolation.rb +1 -1
  44. data/lib/rubocop/cop/style/redundant_parentheses.rb +4 -1
  45. data/lib/rubocop/cop/style/redundant_self.rb +3 -0
  46. data/lib/rubocop/cop/style/single_line_methods.rb +4 -1
  47. data/lib/rubocop/cop/style/sole_nested_conditional.rb +2 -1
  48. data/lib/rubocop/cop/style/symbol_proc.rb +1 -1
  49. data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
  50. data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
  51. data/lib/rubocop/lsp/diagnostic.rb +4 -4
  52. data/lib/rubocop/pending_cops_reporter.rb +56 -0
  53. data/lib/rubocop/server/cache.rb +4 -2
  54. data/lib/rubocop/server/client_command/base.rb +10 -0
  55. data/lib/rubocop/server/client_command/exec.rb +2 -1
  56. data/lib/rubocop/server/client_command/start.rb +11 -1
  57. data/lib/rubocop/version.rb +1 -1
  58. data/lib/rubocop.rb +3 -0
  59. data/lib/ruby_lsp/rubocop/addon.rb +2 -2
  60. metadata +7 -4
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.76.2'
6
+ STRING = '1.78.0'
7
7
 
8
8
  MSG = '%<version>s (using %<parser_version>s, ' \
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
data/lib/rubocop.rb CHANGED
@@ -180,6 +180,7 @@ require_relative 'rubocop/cop/bundler/insecure_protocol_source'
180
180
  require_relative 'rubocop/cop/bundler/ordered_gems'
181
181
 
182
182
  require_relative 'rubocop/cop/gemspec/add_runtime_dependency'
183
+ require_relative 'rubocop/cop/gemspec/attribute_assignment'
183
184
  require_relative 'rubocop/cop/gemspec/dependency_version'
184
185
  require_relative 'rubocop/cop/gemspec/deprecated_attribute_assignment'
185
186
  require_relative 'rubocop/cop/gemspec/development_dependencies'
@@ -507,6 +508,7 @@ require_relative 'rubocop/cop/style/class_methods_definitions'
507
508
  require_relative 'rubocop/cop/style/class_vars'
508
509
  require_relative 'rubocop/cop/style/collection_compact'
509
510
  require_relative 'rubocop/cop/style/collection_methods'
511
+ require_relative 'rubocop/cop/style/collection_querying'
510
512
  require_relative 'rubocop/cop/style/colon_method_call'
511
513
  require_relative 'rubocop/cop/style/colon_method_definition'
512
514
  require_relative 'rubocop/cop/style/combinable_defined'
@@ -810,6 +812,7 @@ require_relative 'rubocop/options'
810
812
  require_relative 'rubocop/remote_config'
811
813
  require_relative 'rubocop/target_ruby'
812
814
  require_relative 'rubocop/yaml_duplication_checker'
815
+ require_relative 'rubocop/pending_cops_reporter'
813
816
 
814
817
  # rubocop:enable Style/RequireOrder
815
818
 
@@ -34,7 +34,7 @@ module RubyLsp
34
34
  @runtime_adapter = nil
35
35
  end
36
36
 
37
- # rubocop:disable Layout/LineLength, Metrics/MethodLength
37
+ # rubocop:disable Metrics/MethodLength
38
38
  def register_additional_file_watchers(global_state, message_queue)
39
39
  return unless global_state.supports_watching_files
40
40
 
@@ -59,7 +59,7 @@ module RubyLsp
59
59
  )
60
60
  )
61
61
  end
62
- # rubocop:enable Layout/LineLength, Metrics/MethodLength
62
+ # rubocop:enable Metrics/MethodLength
63
63
 
64
64
  def workspace_did_change_watched_files(changes)
65
65
  return unless changes.any? { |change| change[:uri].end_with?('.rubocop.yml') }
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.76.2
4
+ version: 1.78.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -9,7 +9,7 @@ authors:
9
9
  - Yuji Nakayama
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-06-17 00:00:00.000000000 Z
12
+ date: 2025-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -265,6 +265,7 @@ files:
265
265
  - lib/rubocop/cop/exclude_limit.rb
266
266
  - lib/rubocop/cop/force.rb
267
267
  - lib/rubocop/cop/gemspec/add_runtime_dependency.rb
268
+ - lib/rubocop/cop/gemspec/attribute_assignment.rb
268
269
  - lib/rubocop/cop/gemspec/dependency_version.rb
269
270
  - lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb
270
271
  - lib/rubocop/cop/gemspec/development_dependencies.rb
@@ -727,6 +728,7 @@ files:
727
728
  - lib/rubocop/cop/style/class_vars.rb
728
729
  - lib/rubocop/cop/style/collection_compact.rb
729
730
  - lib/rubocop/cop/style/collection_methods.rb
731
+ - lib/rubocop/cop/style/collection_querying.rb
730
732
  - lib/rubocop/cop/style/colon_method_call.rb
731
733
  - lib/rubocop/cop/style/colon_method_definition.rb
732
734
  - lib/rubocop/cop/style/combinable_defined.rb
@@ -1038,6 +1040,7 @@ files:
1038
1040
  - lib/rubocop/name_similarity.rb
1039
1041
  - lib/rubocop/options.rb
1040
1042
  - lib/rubocop/path_util.rb
1043
+ - lib/rubocop/pending_cops_reporter.rb
1041
1044
  - lib/rubocop/platform.rb
1042
1045
  - lib/rubocop/plugin.rb
1043
1046
  - lib/rubocop/plugin/configuration_integrator.rb
@@ -1085,9 +1088,9 @@ licenses:
1085
1088
  - MIT
1086
1089
  metadata:
1087
1090
  homepage_uri: https://rubocop.org/
1088
- changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.76.2
1091
+ changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.78.0
1089
1092
  source_code_uri: https://github.com/rubocop/rubocop/
1090
- documentation_uri: https://docs.rubocop.org/rubocop/1.76/
1093
+ documentation_uri: https://docs.rubocop.org/rubocop/1.78/
1091
1094
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
1092
1095
  rubygems_mfa_required: 'true'
1093
1096
  rdoc_options: []