rubocop 0.73.0 → 0.74.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/console +1 -0
  4. data/config/default.yml +2 -1
  5. data/lib/rubocop.rb +3 -0
  6. data/lib/rubocop/ast/node.rb +1 -7
  7. data/lib/rubocop/config.rb +17 -537
  8. data/lib/rubocop/config_obsoletion.rb +201 -0
  9. data/lib/rubocop/config_validator.rb +239 -0
  10. data/lib/rubocop/cop/layout/extra_spacing.rb +14 -53
  11. data/lib/rubocop/cop/layout/indentation_width.rb +19 -5
  12. data/lib/rubocop/cop/layout/space_around_operators.rb +42 -23
  13. data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +22 -40
  14. data/lib/rubocop/cop/lint/debugger.rb +0 -2
  15. data/lib/rubocop/cop/lint/empty_interpolation.rb +4 -4
  16. data/lib/rubocop/cop/lint/erb_new_arguments.rb +56 -0
  17. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +7 -8
  18. data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +6 -6
  19. data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +6 -1
  20. data/lib/rubocop/cop/metrics/line_length.rb +6 -0
  21. data/lib/rubocop/cop/mixin/documentation_comment.rb +0 -2
  22. data/lib/rubocop/cop/mixin/interpolation.rb +27 -0
  23. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +87 -0
  24. data/lib/rubocop/cop/mixin/surrounding_space.rb +7 -5
  25. data/lib/rubocop/cop/style/commented_keyword.rb +8 -28
  26. data/lib/rubocop/cop/style/conditional_assignment.rb +1 -3
  27. data/lib/rubocop/cop/style/constant_visibility.rb +13 -2
  28. data/lib/rubocop/cop/style/guard_clause.rb +39 -10
  29. data/lib/rubocop/cop/style/lambda.rb +0 -2
  30. data/lib/rubocop/cop/style/trailing_method_end_statement.rb +4 -6
  31. data/lib/rubocop/cop/style/variable_interpolation.rb +6 -16
  32. data/lib/rubocop/path_util.rb +1 -1
  33. data/lib/rubocop/processed_source.rb +4 -0
  34. data/lib/rubocop/rspec/expect_offense.rb +4 -1
  35. data/lib/rubocop/version.rb +1 -1
  36. metadata +5 -2
@@ -123,6 +123,10 @@ module RuboCop
123
123
  lines[token.line - 2]
124
124
  end
125
125
 
126
+ def current_line(token)
127
+ lines[token.line - 1]
128
+ end
129
+
126
130
  def following_line(token)
127
131
  lines[token.line]
128
132
  end
@@ -132,7 +132,10 @@ module RuboCop
132
132
  def expect_no_offenses(source, file = nil)
133
133
  inspect_source(source, file)
134
134
 
135
- expect(cop.offenses).to be_empty
135
+ expected_annotations = AnnotatedSource.parse(source)
136
+ actual_annotations =
137
+ expected_annotations.with_offense_annotations(cop.offenses)
138
+ expect(actual_annotations.to_s).to eq(source)
136
139
  end
137
140
 
138
141
  # Parsed representation of code annotated with the `^^^ Message` style
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '0.73.0'
6
+ STRING = '0.74.0'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, running on ' \
9
9
  '%<ruby_engine>s %<ruby_version>s %<ruby_platform>s)'
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: 0.73.0
4
+ version: 0.74.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: 2019-07-16 00:00:00.000000000 Z
13
+ date: 2019-07-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jaro_winkler
@@ -202,7 +202,9 @@ files:
202
202
  - lib/rubocop/config.rb
203
203
  - lib/rubocop/config_loader.rb
204
204
  - lib/rubocop/config_loader_resolver.rb
205
+ - lib/rubocop/config_obsoletion.rb
205
206
  - lib/rubocop/config_store.rb
207
+ - lib/rubocop/config_validator.rb
206
208
  - lib/rubocop/cop/autocorrect_logic.rb
207
209
  - lib/rubocop/cop/badge.rb
208
210
  - lib/rubocop/cop/bundler/duplicated_gem.rb
@@ -450,6 +452,7 @@ files:
450
452
  - lib/rubocop/cop/mixin/ignored_methods.rb
451
453
  - lib/rubocop/cop/mixin/ignored_pattern.rb
452
454
  - lib/rubocop/cop/mixin/integer_node.rb
455
+ - lib/rubocop/cop/mixin/interpolation.rb
453
456
  - lib/rubocop/cop/mixin/match_range.rb
454
457
  - lib/rubocop/cop/mixin/method_complexity.rb
455
458
  - lib/rubocop/cop/mixin/method_preference.rb