rubocop 1.17.0 → 1.18.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +70 -29
  4. data/lib/rubocop.rb +2 -0
  5. data/lib/rubocop/cli/command/suggest_extensions.rb +3 -3
  6. data/lib/rubocop/config_loader.rb +1 -1
  7. data/lib/rubocop/config_loader_resolver.rb +1 -1
  8. data/lib/rubocop/config_validator.rb +23 -10
  9. data/lib/rubocop/cop/base.rb +2 -2
  10. data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
  11. data/lib/rubocop/cop/bundler/gem_version.rb +38 -4
  12. data/lib/rubocop/cop/corrector.rb +4 -4
  13. data/lib/rubocop/cop/generator.rb +1 -1
  14. data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +1 -1
  15. data/lib/rubocop/cop/layout/argument_alignment.rb +1 -1
  16. data/lib/rubocop/cop/layout/array_alignment.rb +2 -2
  17. data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
  18. data/lib/rubocop/cop/layout/class_structure.rb +5 -1
  19. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +7 -1
  20. data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
  21. data/lib/rubocop/cop/layout/end_alignment.rb +8 -1
  22. data/lib/rubocop/cop/layout/first_argument_indentation.rb +1 -1
  23. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -2
  24. data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +2 -2
  25. data/lib/rubocop/cop/layout/first_parameter_indentation.rb +1 -1
  26. data/lib/rubocop/cop/layout/hash_alignment.rb +25 -24
  27. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
  28. data/lib/rubocop/cop/layout/indentation_style.rb +2 -2
  29. data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +122 -0
  30. data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +6 -6
  31. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +2 -2
  32. data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +6 -6
  33. data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +6 -6
  34. data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +6 -6
  35. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +3 -3
  36. data/lib/rubocop/cop/layout/parameter_alignment.rb +2 -2
  37. data/lib/rubocop/cop/layout/space_around_operators.rb +5 -1
  38. data/lib/rubocop/cop/lint/duplicate_branch.rb +2 -1
  39. data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
  40. data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
  41. data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
  42. data/lib/rubocop/cop/lint/symbol_conversion.rb +1 -1
  43. data/lib/rubocop/cop/lint/unused_block_argument.rb +1 -1
  44. data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
  45. data/lib/rubocop/cop/lint/useless_times.rb +1 -1
  46. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
  47. data/lib/rubocop/cop/mixin/check_line_breakable.rb +12 -3
  48. data/lib/rubocop/cop/mixin/hash_transform_method.rb +6 -1
  49. data/lib/rubocop/cop/naming/inclusive_language.rb +249 -0
  50. data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +2 -2
  51. data/lib/rubocop/cop/style/block_delimiters.rb +15 -0
  52. data/lib/rubocop/cop/style/class_and_module_children.rb +14 -0
  53. data/lib/rubocop/cop/style/comment_annotation.rb +50 -6
  54. data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -7
  55. data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
  56. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +8 -2
  57. data/lib/rubocop/cop/style/hash_syntax.rb +1 -1
  58. data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
  59. data/lib/rubocop/cop/style/mutable_constant.rb +6 -8
  60. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
  61. data/lib/rubocop/cop/style/quoted_symbols.rb +2 -2
  62. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +1 -1
  63. data/lib/rubocop/cop/style/regexp_literal.rb +3 -2
  64. data/lib/rubocop/cop/style/single_line_methods.rb +25 -15
  65. data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
  66. data/lib/rubocop/cop/style/string_concatenation.rb +32 -5
  67. data/lib/rubocop/cop/style/string_literals.rb +2 -2
  68. data/lib/rubocop/cop/style/swap_values.rb +1 -1
  69. data/lib/rubocop/cop/style/unpack_first.rb +1 -1
  70. data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
  71. data/lib/rubocop/formatter/git_hub_actions_formatter.rb +1 -1
  72. data/lib/rubocop/options.rb +4 -4
  73. data/lib/rubocop/rspec/cop_helper.rb +1 -1
  74. data/lib/rubocop/rspec/expect_offense.rb +1 -1
  75. data/lib/rubocop/version.rb +1 -1
  76. metadata +11 -9
@@ -87,10 +87,10 @@ module RuboCop
87
87
  def message(_node)
88
88
  if style == :single_quotes
89
89
  "Prefer single-quoted strings when you don't need string " \
90
- 'interpolation or special symbols.'
90
+ 'interpolation or special symbols.'
91
91
  else
92
92
  'Prefer double-quoted strings unless you need single quotes to ' \
93
- 'avoid extra backslashes for escaping.'
93
+ 'avoid extra backslashes for escaping.'
94
94
  end
95
95
  end
96
96
 
@@ -21,7 +21,7 @@ module RuboCop
21
21
  extend AutoCorrector
22
22
 
23
23
  MSG = 'Replace this and assignments at lines %<x_line>d '\
24
- 'and %<y_line>d with `%<replacement>s`.'
24
+ 'and %<y_line>d with `%<replacement>s`.'
25
25
 
26
26
  SIMPLE_ASSIGNMENT_TYPES = %i[lvasgn ivasgn cvasgn gvasgn casgn].to_set.freeze
27
27
 
@@ -21,7 +21,7 @@ module RuboCop
21
21
  extend AutoCorrector
22
22
 
23
23
  MSG = 'Use `%<receiver>s.unpack1(%<format>s)` instead of '\
24
- '`%<receiver>s.unpack(%<format>s)%<method>s`.'
24
+ '`%<receiver>s.unpack(%<format>s)%<method>s`.'
25
25
  RESTRICT_ON_SEND = %i[first [] slice at].freeze
26
26
 
27
27
  # @!method unpack_and_first_element?(node)
@@ -58,7 +58,7 @@ module RuboCop
58
58
 
59
59
  unless variable
60
60
  raise "Assigning to undeclared local variable \"#{name}\" " \
61
- "at #{node.source_range}, #{node.inspect}"
61
+ "at #{node.source_range}, #{node.inspect}"
62
62
  end
63
63
 
64
64
  variable.assign(node)
@@ -33,7 +33,7 @@ module RuboCop
33
33
  output.printf(
34
34
  "\n::%<severity>s file=%<file>s,line=%<line>d,col=%<column>d::%<message>s\n",
35
35
  severity: github_severity(offense),
36
- file: file,
36
+ file: PathUtil.smart_path(file),
37
37
  line: offense.line,
38
38
  column: offense.real_column,
39
39
  message: github_escape(offense.message)
@@ -12,9 +12,9 @@ module RuboCop
12
12
  # @api private
13
13
  class Options
14
14
  E_STDIN_NO_PATH = '-s/--stdin requires exactly one path, relative to the ' \
15
- 'root of the project. RuboCop will use this path to determine which ' \
16
- 'cops are enabled (via eg. Include/Exclude), and so that certain cops ' \
17
- 'like Naming/FileName can be checked.'
15
+ 'root of the project. RuboCop will use this path to determine which ' \
16
+ 'cops are enabled (via eg. Include/Exclude), and so that certain cops ' \
17
+ 'like Naming/FileName can be checked.'
18
18
  EXITING_OPTIONS = %i[version verbose_version show_cops].freeze
19
19
  DEFAULT_MAXIMUM_EXCLUSION_ITEMS = 15
20
20
 
@@ -292,7 +292,7 @@ module RuboCop
292
292
 
293
293
  if display_only_fail_level_offenses_with_autocorrect?
294
294
  raise OptionArgumentError, '--autocorrect cannot be used with ' \
295
- '--display-only-fail-level-offenses'
295
+ '--display-only-fail-level-offenses'
296
296
  end
297
297
  validate_auto_gen_config
298
298
  validate_auto_correct
@@ -15,7 +15,7 @@ module CopHelper
15
15
  processed_source = parse_source(source, file)
16
16
  unless processed_source.valid_syntax?
17
17
  raise 'Error parsing example code: ' \
18
- "#{processed_source.diagnostics.map(&:render).join("\n")}"
18
+ "#{processed_source.diagnostics.map(&:render).join("\n")}"
19
19
  end
20
20
 
21
21
  _investigate(cop, processed_source)
@@ -195,7 +195,7 @@ module RuboCop
195
195
  return processed_source if processed_source.valid_syntax?
196
196
 
197
197
  raise 'Error parsing example code: ' \
198
- "#{processed_source.diagnostics.map(&:render).join("\n")}"
198
+ "#{processed_source.diagnostics.map(&:render).join("\n")}"
199
199
  end
200
200
 
201
201
  def set_formatter_options
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.17.0'
6
+ STRING = '1.18.4'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, '\
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
8
8
  - Jonas Arvidsson
9
9
  - Yuji Nakayama
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-06-15 00:00:00.000000000 Z
13
+ date: 2021-07-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -100,7 +100,7 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.7.0
103
+ version: 1.8.0
104
104
  - - "<"
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.0'
@@ -110,7 +110,7 @@ dependencies:
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 1.7.0
113
+ version: 1.8.0
114
114
  - - "<"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '2.0'
@@ -319,6 +319,7 @@ files:
319
319
  - lib/rubocop/cop/layout/initial_indentation.rb
320
320
  - lib/rubocop/cop/layout/leading_comment_space.rb
321
321
  - lib/rubocop/cop/layout/leading_empty_lines.rb
322
+ - lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb
322
323
  - lib/rubocop/cop/layout/line_length.rb
323
324
  - lib/rubocop/cop/layout/multiline_array_brace_layout.rb
324
325
  - lib/rubocop/cop/layout/multiline_array_line_breaks.rb
@@ -579,6 +580,7 @@ files:
579
580
  - lib/rubocop/cop/naming/file_name.rb
580
581
  - lib/rubocop/cop/naming/heredoc_delimiter_case.rb
581
582
  - lib/rubocop/cop/naming/heredoc_delimiter_naming.rb
583
+ - lib/rubocop/cop/naming/inclusive_language.rb
582
584
  - lib/rubocop/cop/naming/memoized_instance_variable_name.rb
583
585
  - lib/rubocop/cop/naming/method_name.rb
584
586
  - lib/rubocop/cop/naming/method_parameter_name.rb
@@ -881,9 +883,9 @@ metadata:
881
883
  homepage_uri: https://rubocop.org/
882
884
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
883
885
  source_code_uri: https://github.com/rubocop/rubocop/
884
- documentation_uri: https://docs.rubocop.org/rubocop/1.17/
886
+ documentation_uri: https://docs.rubocop.org/rubocop/1.18/
885
887
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
886
- post_install_message:
888
+ post_install_message:
887
889
  rdoc_options: []
888
890
  require_paths:
889
891
  - lib
@@ -898,8 +900,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
898
900
  - !ruby/object:Gem::Version
899
901
  version: '0'
900
902
  requirements: []
901
- rubygems_version: 3.2.18
902
- signing_key:
903
+ rubygems_version: 3.1.2
904
+ signing_key:
903
905
  specification_version: 4
904
906
  summary: Automatic Ruby code style checking tool.
905
907
  test_files: []