rubocop 1.80.0 → 1.80.1
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.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +6 -3
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -7
- data/lib/rubocop/cop/style/redundant_begin.rb +2 -0
- data/lib/rubocop/cop/style/string_concatenation.rb +1 -1
- data/lib/rubocop/result_cache.rb +1 -1
- data/lib/rubocop/runner.rb +6 -4
- data/lib/rubocop/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a047d4a83faf5e57dea4820484566645a9041e397a11cd995e9b5c558b0b657
|
4
|
+
data.tar.gz: 80fea4c35729d9eab11bd0d26ec3c98b8127804dd0abf42fda5303065382b772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c971fe82aacd55238ee1b16f0329f4377491f0f1b175454d0cf3178a4fc759c625affbcca853a09dd106430f0e5462134e8ff2a2534ef898768121f3a482575e
|
7
|
+
data.tar.gz: 47bd2586ce3a6568b2b3c6657e104104c30b0440ddac2ec64f96e70fe630e5afffa38fbf9be439ab3d8b7ef29e7b433537279d2a2cd0022a15cf6015d53b4484
|
@@ -29,10 +29,13 @@ module RuboCop
|
|
29
29
|
def align_end(corrector, processed_source, node, align_to)
|
30
30
|
@processed_source = processed_source
|
31
31
|
whitespace = whitespace_range(node)
|
32
|
-
return false unless whitespace.source.strip.empty?
|
33
|
-
|
34
32
|
column = alignment_column(align_to)
|
35
|
-
|
33
|
+
|
34
|
+
if whitespace.source.strip.empty?
|
35
|
+
corrector.replace(whitespace, ' ' * column)
|
36
|
+
else
|
37
|
+
corrector.insert_after(whitespace, "\n#{' ' * column}")
|
38
|
+
end
|
36
39
|
end
|
37
40
|
|
38
41
|
private
|
@@ -19,8 +19,7 @@ module RuboCop
|
|
19
19
|
def check_end_kw_alignment(node, align_ranges)
|
20
20
|
return if ignored_node?(node)
|
21
21
|
|
22
|
-
end_loc = node.loc.end
|
23
|
-
return if accept_end_kw_alignment?(end_loc)
|
22
|
+
return unless (end_loc = node.loc.end)
|
24
23
|
|
25
24
|
matching = matching_ranges(end_loc, align_ranges)
|
26
25
|
|
@@ -57,11 +56,6 @@ module RuboCop
|
|
57
56
|
add_offense(end_loc, message: msg) { |corrector| autocorrect(corrector, node) }
|
58
57
|
end
|
59
58
|
|
60
|
-
def accept_end_kw_alignment?(end_loc)
|
61
|
-
end_loc.nil? || # Discard modifier forms of if/while/until.
|
62
|
-
!/\A[ \t]*end/.match?(processed_source.lines[end_loc.line - 1])
|
63
|
-
end
|
64
|
-
|
65
59
|
def style_parameter_name
|
66
60
|
'EnforcedStyleAlignWith'
|
67
61
|
end
|
data/lib/rubocop/result_cache.rb
CHANGED
@@ -9,7 +9,7 @@ module RuboCop
|
|
9
9
|
# Provides functionality for caching RuboCop runs.
|
10
10
|
# @api private
|
11
11
|
class ResultCache
|
12
|
-
NON_CHANGING = %i[color format formatters out debug fail_level
|
12
|
+
NON_CHANGING = %i[color format formatters out debug display_time fail_level
|
13
13
|
fix_layout autocorrect safe_autocorrect autocorrect_all
|
14
14
|
cache fail_fast stdin parallel].freeze
|
15
15
|
|
data/lib/rubocop/runner.rb
CHANGED
@@ -273,7 +273,8 @@ module RuboCop
|
|
273
273
|
end
|
274
274
|
|
275
275
|
def do_inspection_loop(file)
|
276
|
-
|
276
|
+
# We can reuse the prism result since the source did not change yet.
|
277
|
+
processed_source = get_processed_source(file, @prism_result)
|
277
278
|
# This variable is 2d array used to track corrected offenses after each
|
278
279
|
# inspection iteration. This is used to output meaningful infinite loop
|
279
280
|
# error message.
|
@@ -295,7 +296,8 @@ module RuboCop
|
|
295
296
|
# loop if we find any.
|
296
297
|
break unless updated_source_file
|
297
298
|
|
298
|
-
|
299
|
+
# Autocorrect has happened, don't use the prism result since it is stale.
|
300
|
+
processed_source = get_processed_source(file, nil)
|
299
301
|
end
|
300
302
|
|
301
303
|
# Return summary of corrected offenses after all iterations
|
@@ -482,7 +484,7 @@ module RuboCop
|
|
482
484
|
end
|
483
485
|
|
484
486
|
# rubocop:disable Metrics/MethodLength
|
485
|
-
def get_processed_source(file)
|
487
|
+
def get_processed_source(file, prism_result)
|
486
488
|
config = @config_store.for_file(file)
|
487
489
|
ruby_version = config.target_ruby_version
|
488
490
|
parser_engine = config.parser_engine
|
@@ -493,7 +495,7 @@ module RuboCop
|
|
493
495
|
ruby_version,
|
494
496
|
file,
|
495
497
|
parser_engine: parser_engine,
|
496
|
-
prism_result:
|
498
|
+
prism_result: prism_result
|
497
499
|
)
|
498
500
|
else
|
499
501
|
begin
|
data/lib/rubocop/version.rb
CHANGED
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.80.
|
4
|
+
version: 1.80.1
|
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-08-
|
12
|
+
date: 2025-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -1090,7 +1090,7 @@ licenses:
|
|
1090
1090
|
- MIT
|
1091
1091
|
metadata:
|
1092
1092
|
homepage_uri: https://rubocop.org/
|
1093
|
-
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.80.
|
1093
|
+
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.80.1
|
1094
1094
|
source_code_uri: https://github.com/rubocop/rubocop/
|
1095
1095
|
documentation_uri: https://docs.rubocop.org/rubocop/1.80/
|
1096
1096
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|