rubocop 1.63.0 → 1.63.5
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/config/default.yml +0 -1
- data/lib/rubocop/cached_data.rb +11 -3
- data/lib/rubocop/cli.rb +4 -0
- data/lib/rubocop/cop/base.rb +3 -1
- data/lib/rubocop/cop/internal_affairs/example_description.rb +1 -1
- data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -0
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +3 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +1 -1
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +1 -1
- data/lib/rubocop/cop/lint/mixed_case_range.rb +9 -4
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +1 -1
- data/lib/rubocop/cop/lint/unreachable_code.rb +4 -2
- data/lib/rubocop/cop/lint/unreachable_loop.rb +8 -2
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +2 -2
- data/lib/rubocop/cop/security/compound_hash.rb +2 -2
- data/lib/rubocop/cop/style/arguments_forwarding.rb +2 -1
- data/lib/rubocop/cop/style/conditional_assignment.rb +1 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
- data/lib/rubocop/cop/style/map_into_array.rb +2 -2
- data/lib/rubocop/cop/style/numeric_predicate.rb +10 -2
- data/lib/rubocop/cop/style/redundant_line_continuation.rb +3 -1
- data/lib/rubocop/cop/style/require_order.rb +1 -1
- data/lib/rubocop/cop/style/send.rb +4 -4
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -2
- data/lib/rubocop/cop/style/top_level_method_definition.rb +1 -1
- data/lib/rubocop/lockfile.rb +25 -6
- data/lib/rubocop/lsp/routes.rb +3 -4
- data/lib/rubocop/lsp/server.rb +2 -0
- data/lib/rubocop/options.rb +3 -3
- data/lib/rubocop/rake_task.rb +1 -1
- data/lib/rubocop/runner.rb +5 -4
- data/lib/rubocop/version.rb +4 -4
- 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: 1911c884de81dd524490fea5075e7605d3ccf82fad85ebc9d09adbe5d29637ca
|
4
|
+
data.tar.gz: 8206c237dd18bbcd9769d55b1206d160ce766a21caa5c8f8ea956ae845371ea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 429dfdfda489516f4856fa00ad50c062a172588ca4bb1006baa25213c2fb949b0781af446d689200f0a87017f47708ad49324a6644cce104f79dd42b129dd680
|
7
|
+
data.tar.gz: ce8363fa68a56f9c5f36c40d1596932b1233854823c54bfb9dc36a669256dca64459186037fe10e9723a550cec0a6f11df2e1d802e4471d8c9d1e98db8c528f3
|
data/config/default.yml
CHANGED
data/lib/rubocop/cached_data.rb
CHANGED
@@ -48,11 +48,19 @@ module RuboCop
|
|
48
48
|
source_buffer = Parser::Source::Buffer.new(@filename)
|
49
49
|
source_buffer.source = File.read(@filename, encoding: Encoding::UTF_8)
|
50
50
|
offenses.map! do |o|
|
51
|
-
location =
|
52
|
-
o['location']['begin_pos'],
|
53
|
-
o['location']['end_pos'])
|
51
|
+
location = location_from_source_buffer(o, source_buffer)
|
54
52
|
Cop::Offense.new(o['severity'], location, o['message'], o['cop_name'], o['status'].to_sym)
|
55
53
|
end
|
56
54
|
end
|
55
|
+
|
56
|
+
def location_from_source_buffer(offense, source_buffer)
|
57
|
+
begin_pos = offense['location']['begin_pos']
|
58
|
+
end_pos = offense['location']['end_pos']
|
59
|
+
if begin_pos.zero? && end_pos.zero?
|
60
|
+
Cop::Offense::NO_LOCATION
|
61
|
+
else
|
62
|
+
Parser::Source::Range.new(source_buffer, begin_pos, end_pos)
|
63
|
+
end
|
64
|
+
end
|
57
65
|
end
|
58
66
|
end
|
data/lib/rubocop/cli.rb
CHANGED
@@ -57,6 +57,10 @@ module RuboCop
|
|
57
57
|
rescue RuboCop::Error => e
|
58
58
|
warn Rainbow("Error: #{e.message}").red
|
59
59
|
STATUS_ERROR
|
60
|
+
rescue Interrupt
|
61
|
+
warn ''
|
62
|
+
warn 'Exiting...'
|
63
|
+
STATUS_INTERRUPTED
|
60
64
|
rescue Finished
|
61
65
|
STATUS_SUCCESS
|
62
66
|
rescue OptionParser::InvalidOption => e
|
data/lib/rubocop/cop/base.rb
CHANGED
@@ -186,7 +186,9 @@ module RuboCop
|
|
186
186
|
def add_global_offense(message = nil, severity: nil)
|
187
187
|
severity = find_severity(nil, severity)
|
188
188
|
message = find_message(nil, message)
|
189
|
-
|
189
|
+
range = Offense::NO_LOCATION
|
190
|
+
status = enabled_line?(range.line) ? :unsupported : :disabled
|
191
|
+
current_offenses << Offense.new(severity, range, message, name, status)
|
190
192
|
end
|
191
193
|
|
192
194
|
# Adds an offense on the specified range (or node with an expression)
|
@@ -46,7 +46,7 @@ module RuboCop
|
|
46
46
|
/\A(does not|doesn't) (register|find|flag|report)/ => 'registers',
|
47
47
|
/\A(does not|doesn't) add (a|an|any )?offense/ => 'registers an offense',
|
48
48
|
/\Aregisters no offense/ => 'registers an offense',
|
49
|
-
/\
|
49
|
+
/\A(accepts|register)\b/ => 'registers'
|
50
50
|
}.freeze
|
51
51
|
|
52
52
|
EXPECT_NO_CORRECTIONS_DESCRIPTION_MAPPING = {
|
@@ -88,7 +88,9 @@ module RuboCop
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def skip_children?(asgn_node)
|
91
|
-
|
91
|
+
(asgn_node.call_type? && !asgn_node.assignment_method?) ||
|
92
|
+
empty_condition?(asgn_node) ||
|
93
|
+
(safe_assignment_allowed? && safe_assignment?(asgn_node))
|
92
94
|
end
|
93
95
|
|
94
96
|
def traverse_node(node, &block)
|
@@ -52,7 +52,7 @@ module RuboCop
|
|
52
52
|
# @!method deprecated_class_method?(node)
|
53
53
|
def_node_matcher :deprecated_class_method?, <<~PATTERN
|
54
54
|
{
|
55
|
-
(send (const {cbase nil?}
|
55
|
+
(send (const {cbase nil?} :ENV) {:clone :dup :freeze})
|
56
56
|
(send (const {cbase nil?} {:File :Dir}) :exists? _)
|
57
57
|
(send (const {cbase nil?} :Socket) {:gethostbyaddr :gethostbyname} ...)
|
58
58
|
(send nil? :attr _ boolean)
|
@@ -146,7 +146,7 @@ module RuboCop
|
|
146
146
|
node.source_range.with(end_pos: node.condition.source_range.end_pos)
|
147
147
|
elsif all_branches_body_missing?(node)
|
148
148
|
if_node = node.ancestors.detect(&:if?)
|
149
|
-
node.source_range.
|
149
|
+
node.source_range.join(if_node.loc.end.end)
|
150
150
|
else
|
151
151
|
node.source_range
|
152
152
|
end
|
@@ -47,8 +47,10 @@ module RuboCop
|
|
47
47
|
|
48
48
|
def on_regexp(node)
|
49
49
|
each_unsafe_regexp_range(node) do |loc|
|
50
|
+
next unless (replacement = regexp_range(loc.source))
|
51
|
+
|
50
52
|
add_offense(loc) do |corrector|
|
51
|
-
corrector.replace(loc,
|
53
|
+
corrector.replace(loc, replacement)
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
@@ -99,10 +101,13 @@ module RuboCop
|
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
102
|
-
def
|
104
|
+
def regexp_range(source)
|
103
105
|
open, close = source.split('-')
|
104
|
-
|
105
|
-
|
106
|
+
return unless (open_range = range_for(open))
|
107
|
+
return unless (close_range = range_for(close))
|
108
|
+
|
109
|
+
first = [open, open_range.end]
|
110
|
+
second = [close_range.begin, close]
|
106
111
|
"#{first.uniq.join('-')}#{second.uniq.join('-')}"
|
107
112
|
end
|
108
113
|
end
|
@@ -130,7 +130,7 @@ module RuboCop
|
|
130
130
|
# @return [Parser::Source::Range]
|
131
131
|
#
|
132
132
|
def last_arg_range(node)
|
133
|
-
node.last_argument.source_range.
|
133
|
+
node.last_argument.source_range.join(node.arguments[-2].source_range.end)
|
134
134
|
end
|
135
135
|
|
136
136
|
def unsorted_dir_loop?(node)
|
@@ -71,7 +71,7 @@ module RuboCop
|
|
71
71
|
expressions.any? { |expr| flow_expression?(expr) }
|
72
72
|
when :if
|
73
73
|
check_if(node)
|
74
|
-
when :case
|
74
|
+
when :case, :case_match
|
75
75
|
check_case(node)
|
76
76
|
else
|
77
77
|
false
|
@@ -89,7 +89,9 @@ module RuboCop
|
|
89
89
|
return false unless else_branch
|
90
90
|
return false unless flow_expression?(else_branch)
|
91
91
|
|
92
|
-
node.
|
92
|
+
branches = node.case_type? ? node.when_branches : node.in_pattern_branches
|
93
|
+
|
94
|
+
branches.all? { |branch| branch.body && flow_expression?(branch.body) }
|
93
95
|
end
|
94
96
|
end
|
95
97
|
end
|
@@ -160,7 +160,7 @@ module RuboCop
|
|
160
160
|
break_statement && !preceded_by_continue_statement?(break_statement)
|
161
161
|
when :if
|
162
162
|
check_if(node)
|
163
|
-
when :case
|
163
|
+
when :case, :case_match
|
164
164
|
check_case(node)
|
165
165
|
else
|
166
166
|
false
|
@@ -178,7 +178,13 @@ module RuboCop
|
|
178
178
|
return false unless else_branch
|
179
179
|
return false unless break_statement?(else_branch)
|
180
180
|
|
181
|
-
|
181
|
+
branches = if node.case_type?
|
182
|
+
node.when_branches
|
183
|
+
else
|
184
|
+
node.in_pattern_branches
|
185
|
+
end
|
186
|
+
|
187
|
+
branches.all? { |branch| branch.body && break_statement?(branch.body) }
|
182
188
|
end
|
183
189
|
|
184
190
|
def preceded_by_continue_statement?(break_statement)
|
@@ -51,8 +51,8 @@ module RuboCop
|
|
51
51
|
when :method_call
|
52
52
|
->(node) { node.call_type? }
|
53
53
|
else
|
54
|
-
raise
|
55
|
-
|
54
|
+
raise Warning, "Unknown foldable type: #{type.inspect}. " \
|
55
|
+
"Valid foldable types are: #{FOLDABLE_TYPES.join(', ')}."
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -30,8 +30,8 @@ module RuboCop
|
|
30
30
|
class CompoundHash < Base
|
31
31
|
COMBINATOR_IN_HASH_MSG = 'Use `[...].hash` instead of combining hash values manually.'
|
32
32
|
MONUPLE_HASH_MSG =
|
33
|
-
'Delegate hash directly without wrapping in an array when only using a single value'
|
34
|
-
REDUNDANT_HASH_MSG = 'Calling .hash on elements of a hashed array is redundant'
|
33
|
+
'Delegate hash directly without wrapping in an array when only using a single value.'
|
34
|
+
REDUNDANT_HASH_MSG = 'Calling .hash on elements of a hashed array is redundant.'
|
35
35
|
|
36
36
|
# @!method hash_method_definition?(node)
|
37
37
|
def_node_matcher :hash_method_definition?, <<~PATTERN
|
@@ -312,7 +312,8 @@ module RuboCop
|
|
312
312
|
end
|
313
313
|
|
314
314
|
def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg)
|
315
|
-
return if target_ruby_version <= 3.0 ||
|
315
|
+
return if target_ruby_version <= 3.0 ||
|
316
|
+
block_arg.nil? || block_arg.source == '&' || explicit_block_name?
|
316
317
|
|
317
318
|
add_offense(block_arg, message: BLOCK_MSG) do |corrector|
|
318
319
|
add_parens_if_missing(def_arguments_or_send, corrector) if add_parens
|
@@ -214,7 +214,7 @@ module RuboCop
|
|
214
214
|
extend AutoCorrector
|
215
215
|
|
216
216
|
MSG = 'Use the return of the conditional for variable assignment and comparison.'
|
217
|
-
ASSIGN_TO_CONDITION_MSG = 'Assign variables inside of conditionals'
|
217
|
+
ASSIGN_TO_CONDITION_MSG = 'Assign variables inside of conditionals.'
|
218
218
|
VARIABLE_ASSIGNMENT_TYPES = %i[casgn cvasgn gvasgn ivasgn lvasgn].freeze
|
219
219
|
ASSIGNMENT_TYPES = VARIABLE_ASSIGNMENT_TYPES + %i[and_asgn or_asgn op_asgn masgn].freeze
|
220
220
|
LINE_LENGTH = 'Layout/LineLength'
|
@@ -20,8 +20,8 @@ module RuboCop
|
|
20
20
|
#
|
21
21
|
# [source,ruby]
|
22
22
|
# ----
|
23
|
-
#
|
24
|
-
# src.each { |e|
|
23
|
+
# ret = []
|
24
|
+
# src.each { |e| ret << e * 2 } # `<<` method may mutate `ret`
|
25
25
|
#
|
26
26
|
# dest = []
|
27
27
|
# src.each { |e| dest << transform(e, dest) } # `transform` method may mutate `dest`
|
@@ -118,12 +118,14 @@ module RuboCop
|
|
118
118
|
|
119
119
|
return unless numeric && operator && replacement_supported?(operator)
|
120
120
|
|
121
|
-
[numeric, replacement(numeric, operator)]
|
121
|
+
[numeric, replacement(node, numeric, operator)]
|
122
122
|
end
|
123
123
|
|
124
|
-
def replacement(numeric, operation)
|
124
|
+
def replacement(node, numeric, operation)
|
125
125
|
if style == :predicate
|
126
126
|
[parenthesized_source(numeric), REPLACEMENTS.invert[operation.to_s]].join('.')
|
127
|
+
elsif negated?(node)
|
128
|
+
"(#{numeric.source} #{REPLACEMENTS[operation.to_s]} 0)"
|
127
129
|
else
|
128
130
|
[numeric.source, REPLACEMENTS[operation.to_s], 0].join(' ')
|
129
131
|
end
|
@@ -157,6 +159,12 @@ module RuboCop
|
|
157
159
|
end
|
158
160
|
end
|
159
161
|
|
162
|
+
def negated?(node)
|
163
|
+
return false unless (parent = node.parent)
|
164
|
+
|
165
|
+
parent.send_type? && parent.method?(:!)
|
166
|
+
end
|
167
|
+
|
160
168
|
# @!method predicate(node)
|
161
169
|
def_node_matcher :predicate, <<~PATTERN
|
162
170
|
(send $(...) ${:zero? :positive? :negative?})
|
@@ -137,7 +137,9 @@ module RuboCop
|
|
137
137
|
# do_something \
|
138
138
|
# argument
|
139
139
|
def method_with_argument?(current_token, next_token)
|
140
|
-
current_token.type
|
140
|
+
return false if current_token.type != :tIDENTIFIER && current_token.type != :kRETURN
|
141
|
+
|
142
|
+
ARGUMENT_TYPES.include?(next_token.type)
|
141
143
|
end
|
142
144
|
|
143
145
|
# rubocop:disable Metrics/AbcSize
|
@@ -131,7 +131,7 @@ module RuboCop
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def in_same_section?(node1, node2)
|
134
|
-
!node1.source_range.
|
134
|
+
!node1.source_range.join(node2.source_range.end).source.include?("\n\n")
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -7,12 +7,12 @@ module RuboCop
|
|
7
7
|
#
|
8
8
|
# @example
|
9
9
|
# # bad
|
10
|
-
# Foo.send(
|
11
|
-
# quuz.send(
|
10
|
+
# Foo.send(bar)
|
11
|
+
# quuz.send(fred)
|
12
12
|
#
|
13
13
|
# # good
|
14
|
-
# Foo.__send__(
|
15
|
-
# quuz.public_send(
|
14
|
+
# Foo.__send__(bar)
|
15
|
+
# quuz.public_send(fred)
|
16
16
|
class Send < Base
|
17
17
|
MSG = 'Prefer `Object#__send__` or `Object#public_send` to `send`.'
|
18
18
|
RESTRICT_ON_SEND = %i[send].freeze
|
@@ -58,9 +58,8 @@ module RuboCop
|
|
58
58
|
#
|
59
59
|
# @example EnforcedStyle: use_builtin_english_names
|
60
60
|
#
|
61
|
-
# Like `use_perl_names` but allows builtin global vars.
|
62
|
-
#
|
63
61
|
# # good
|
62
|
+
# # Like `use_perl_names` but allows builtin global vars.
|
64
63
|
# puts $LOAD_PATH
|
65
64
|
# puts $LOADED_FEATURES
|
66
65
|
# puts $PROGRAM_NAME
|
data/lib/rubocop/lockfile.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
begin
|
4
|
+
# We might not be running with `bundle exec`, so we need to pull in Bundler ourselves,
|
5
|
+
# in order to use `Bundler::LockfileParser`.
|
6
|
+
require 'bundler'
|
7
|
+
rescue LoadError
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
|
3
11
|
module RuboCop
|
4
12
|
# Encapsulation of a lockfile for use when checking for gems.
|
5
13
|
# Does not actually resolve gems, just parses the lockfile.
|
@@ -7,7 +15,11 @@ module RuboCop
|
|
7
15
|
class Lockfile
|
8
16
|
# @param [String, Pathname, nil] lockfile_path
|
9
17
|
def initialize(lockfile_path = nil)
|
10
|
-
lockfile_path ||=
|
18
|
+
lockfile_path ||= begin
|
19
|
+
::Bundler.default_lockfile if bundler_lock_parser_defined?
|
20
|
+
rescue ::Bundler::GemfileNotFound
|
21
|
+
nil # We might not be a folder with a Gemfile, but that's okay.
|
22
|
+
end
|
11
23
|
|
12
24
|
@lockfile_path = lockfile_path
|
13
25
|
end
|
@@ -59,12 +71,19 @@ module RuboCop
|
|
59
71
|
# @return [Bundler::LockfileParser, nil]
|
60
72
|
def parser
|
61
73
|
return @parser if defined?(@parser)
|
62
|
-
return unless @lockfile_path
|
63
74
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
75
|
+
@parser = if @lockfile_path && bundler_lock_parser_defined?
|
76
|
+
begin
|
77
|
+
lockfile = ::Bundler.read_file(@lockfile_path)
|
78
|
+
::Bundler::LockfileParser.new(lockfile) if lockfile
|
79
|
+
rescue ::Bundler::BundlerError
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def bundler_lock_parser_defined?
|
86
|
+
Object.const_defined?(:Bundler) && Bundler.const_defined?(:LockfileParser)
|
68
87
|
end
|
69
88
|
end
|
70
89
|
end
|
data/lib/rubocop/lsp/routes.rb
CHANGED
@@ -60,8 +60,9 @@ module RuboCop
|
|
60
60
|
|
61
61
|
handle 'initialized' do |_request|
|
62
62
|
version = RuboCop::Version::STRING
|
63
|
+
yjit = Object.const_defined?('RubyVM::YJIT') && RubyVM::YJIT.enabled? ? ' +YJIT' : ''
|
63
64
|
|
64
|
-
Logger.log("RuboCop #{version} language server initialized, PID #{Process.pid}")
|
65
|
+
Logger.log("RuboCop #{version} language server#{yjit} initialized, PID #{Process.pid}")
|
65
66
|
end
|
66
67
|
|
67
68
|
handle 'shutdown' do |request|
|
@@ -73,9 +74,7 @@ module RuboCop
|
|
73
74
|
end
|
74
75
|
|
75
76
|
handle 'textDocument/diagnostic' do |request|
|
76
|
-
|
77
|
-
result = diagnostic(doc[:uri], doc[:text])
|
78
|
-
@server.write(result)
|
77
|
+
# no-op, diagnostics are handled in textDocument/didChange
|
79
78
|
end
|
80
79
|
|
81
80
|
handle 'textDocument/didChange' do |request|
|
data/lib/rubocop/lsp/server.rb
CHANGED
data/lib/rubocop/options.rb
CHANGED
@@ -573,7 +573,7 @@ module RuboCop
|
|
573
573
|
'cops. Only valid for --format junit.'],
|
574
574
|
display_only_fail_level_offenses:
|
575
575
|
['Only output offense messages at',
|
576
|
-
'the specified --fail-level or above'],
|
576
|
+
'the specified --fail-level or above.'],
|
577
577
|
display_only_correctable: ['Only output correctable offense messages.'],
|
578
578
|
display_only_safe_correctable: ['Only output safe-correctable offense messages',
|
579
579
|
'when combined with --display-only-correctable.'],
|
@@ -636,8 +636,8 @@ module RuboCop
|
|
636
636
|
raise_cop_error: ['Raise cop-related errors with cause and location.',
|
637
637
|
'This is used to prevent cops from failing silently.',
|
638
638
|
'Default is false.'],
|
639
|
-
profile: 'Profile rubocop',
|
640
|
-
memory: 'Profile rubocop memory usage'
|
639
|
+
profile: 'Profile rubocop.',
|
640
|
+
memory: 'Profile rubocop memory usage.'
|
641
641
|
}.freeze
|
642
642
|
end
|
643
643
|
# rubocop:enable Metrics/ModuleLength
|
data/lib/rubocop/rake_task.rb
CHANGED
@@ -44,7 +44,7 @@ module RuboCop
|
|
44
44
|
def run_cli(verbose, options)
|
45
45
|
# We lazy-load RuboCop so that the task doesn't dramatically impact the
|
46
46
|
# load time of your Rakefile.
|
47
|
-
|
47
|
+
require_relative '../rubocop'
|
48
48
|
|
49
49
|
cli = CLI.new
|
50
50
|
puts 'Running RuboCop...' if verbose
|
data/lib/rubocop/runner.rb
CHANGED
@@ -20,10 +20,11 @@ module RuboCop
|
|
20
20
|
message = 'Infinite loop detected'
|
21
21
|
message += " in #{path}" if path
|
22
22
|
message += " and caused by #{root_cause}" if root_cause
|
23
|
-
message +=
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
message += "\n"
|
24
|
+
hint = 'Hint: Please update to the latest RuboCop version if not already in use, ' \
|
25
|
+
"and report a bug if the issue still occurs on this version.\n" \
|
26
|
+
'Please check the latest version at https://rubygems.org/gems/rubocop.'
|
27
|
+
super(Rainbow(message).red + Rainbow(hint).yellow)
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
data/lib/rubocop/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
# This module holds the RuboCop version information.
|
5
5
|
module Version
|
6
|
-
STRING = '1.63.
|
6
|
+
STRING = '1.63.5'
|
7
7
|
|
8
8
|
MSG = '%<version>s (using %<parser_version>s, ' \
|
9
9
|
'rubocop-ast %<rubocop_ast_version>s, ' \
|
@@ -42,9 +42,9 @@ module RuboCop
|
|
42
42
|
# @api private
|
43
43
|
def self.parser_version
|
44
44
|
config_path = ConfigFinder.find_config_path(Dir.pwd)
|
45
|
-
yaml =
|
46
|
-
|
47
|
-
|
45
|
+
yaml = Util.silence_warnings do
|
46
|
+
ConfigLoader.load_yaml_configuration(config_path)
|
47
|
+
end
|
48
48
|
|
49
49
|
if yaml.dig('AllCops', 'ParserEngine') == 'parser_prism'
|
50
50
|
require 'prism'
|
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.63.
|
4
|
+
version: 1.63.5
|
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: 2024-
|
13
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -1032,7 +1032,7 @@ licenses:
|
|
1032
1032
|
- MIT
|
1033
1033
|
metadata:
|
1034
1034
|
homepage_uri: https://rubocop.org/
|
1035
|
-
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.63.
|
1035
|
+
changelog_uri: https://github.com/rubocop/rubocop/releases/tag/v1.63.5
|
1036
1036
|
source_code_uri: https://github.com/rubocop/rubocop/
|
1037
1037
|
documentation_uri: https://docs.rubocop.org/rubocop/1.63/
|
1038
1038
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|