rubocop 0.67.0 → 0.67.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/default.yml +1 -1
- data/lib/rubocop/cli.rb +9 -11
- data/lib/rubocop/config_loader_resolver.rb +2 -2
- data/lib/rubocop/cop/commissioner.rb +3 -3
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +2 -2
- data/lib/rubocop/path_util.rb +3 -3
- data/lib/rubocop/processed_source.rb +2 -2
- data/lib/rubocop/remote_config.rb +5 -5
- data/lib/rubocop/result_cache.rb +2 -2
- data/lib/rubocop/runner.rb +2 -2
- data/lib/rubocop/target_finder.rb +2 -6
- data/lib/rubocop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03c624133c90502798d0222665547c79131424bafe7a3a510cd35045436e57df
|
4
|
+
data.tar.gz: fb33bcb26137fd6d682c8ae856f6ca9bda7fa3cf382db841366502e82550402b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 395e690f9116faa81bcef7d436bbd0d86489a694acfb8e011e57705d6264e16f3ff629f7e88af393bfe924cbc61f70c33f8a58aafba67ed2579b28eb2065d2d1
|
7
|
+
data.tar.gz: ccfd1658013fc71b1d82f9e1e133a4c8c14a86e50e8b5c48c94217578de87b226f94aaf843f0a97cf103688ba5049ace1b2c6926d9da7b4a5ccee0aad962827d
|
data/README.md
CHANGED
@@ -53,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
|
|
53
53
|
might want to use a conservative version lock in your `Gemfile`:
|
54
54
|
|
55
55
|
```rb
|
56
|
-
gem 'rubocop', '~> 0.67.
|
56
|
+
gem 'rubocop', '~> 0.67.1', require: false
|
57
57
|
```
|
58
58
|
|
59
59
|
## Quickstart
|
data/config/default.yml
CHANGED
@@ -1939,7 +1939,7 @@ Naming/RescuedExceptionsVariableName:
|
|
1939
1939
|
Description: 'Use consistent rescued exceptions variables naming.'
|
1940
1940
|
Enabled: true
|
1941
1941
|
VersionAdded: '0.67'
|
1942
|
-
PreferredName:
|
1942
|
+
PreferredName: e
|
1943
1943
|
|
1944
1944
|
Naming/UncommunicativeBlockParamName:
|
1945
1945
|
Description: >-
|
data/lib/rubocop/cli.rb
CHANGED
@@ -45,23 +45,21 @@ module RuboCop
|
|
45
45
|
act_on_options
|
46
46
|
apply_default_formatter
|
47
47
|
execute_runners(paths)
|
48
|
-
rescue ConfigNotFoundError,
|
49
|
-
|
50
|
-
OptionArgumentError => ex
|
51
|
-
warn ex.message
|
48
|
+
rescue ConfigNotFoundError, IncorrectCopNameError, OptionArgumentError => e
|
49
|
+
warn e.message
|
52
50
|
STATUS_ERROR
|
53
|
-
rescue RuboCop::Error =>
|
54
|
-
warn Rainbow("Error: #{
|
51
|
+
rescue RuboCop::Error => e
|
52
|
+
warn Rainbow("Error: #{e.message}").red
|
55
53
|
STATUS_ERROR
|
56
54
|
rescue Finished
|
57
55
|
STATUS_SUCCESS
|
58
|
-
rescue OptionParser::InvalidOption =>
|
59
|
-
warn
|
56
|
+
rescue OptionParser::InvalidOption => e
|
57
|
+
warn e.message
|
60
58
|
warn 'For usage information, use --help'
|
61
59
|
STATUS_ERROR
|
62
|
-
rescue StandardError, SyntaxError, LoadError =>
|
63
|
-
warn
|
64
|
-
warn
|
60
|
+
rescue StandardError, SyntaxError, LoadError => e
|
61
|
+
warn e.message
|
62
|
+
warn e.backtrace
|
65
63
|
STATUS_ERROR
|
66
64
|
end
|
67
65
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
@@ -190,9 +190,9 @@ module RuboCop
|
|
190
190
|
def gem_config_path(gem_name, relative_config_path)
|
191
191
|
spec = Gem::Specification.find_by_name(gem_name)
|
192
192
|
File.join(spec.gem_dir, relative_config_path)
|
193
|
-
rescue Gem::LoadError =>
|
193
|
+
rescue Gem::LoadError => e
|
194
194
|
raise Gem::LoadError,
|
195
|
-
"Unable to find gem #{gem_name}; is the gem installed? #{
|
195
|
+
"Unable to find gem #{gem_name}; is the gem installed? #{e}"
|
196
196
|
end
|
197
197
|
end
|
198
198
|
end
|
@@ -104,14 +104,14 @@ module RuboCop
|
|
104
104
|
# cops' `#investigate` methods.
|
105
105
|
def with_cop_error_handling(cop, node = nil)
|
106
106
|
yield
|
107
|
-
rescue StandardError =>
|
108
|
-
raise
|
107
|
+
rescue StandardError => e
|
108
|
+
raise e if @options[:raise_error]
|
109
109
|
|
110
110
|
if node
|
111
111
|
line = node.first_line
|
112
112
|
column = node.loc.column
|
113
113
|
end
|
114
|
-
error = CopError.new(
|
114
|
+
error = CopError.new(e, line, column)
|
115
115
|
@errors[cop] << error
|
116
116
|
end
|
117
117
|
end
|
@@ -13,7 +13,7 @@ module RuboCop
|
|
13
13
|
# # bad
|
14
14
|
# begin
|
15
15
|
# # do something
|
16
|
-
# rescue MyException =>
|
16
|
+
# rescue MyException => exception
|
17
17
|
# # do something
|
18
18
|
# end
|
19
19
|
#
|
@@ -35,7 +35,7 @@ module RuboCop
|
|
35
35
|
# # good
|
36
36
|
# begin
|
37
37
|
# # do something
|
38
|
-
# rescue MyException =>
|
38
|
+
# rescue MyException => exception
|
39
39
|
# # do something
|
40
40
|
# end
|
41
41
|
#
|
data/lib/rubocop/path_util.rb
CHANGED
@@ -41,10 +41,10 @@ module RuboCop
|
|
41
41
|
when Regexp
|
42
42
|
begin
|
43
43
|
path =~ pattern
|
44
|
-
rescue ArgumentError =>
|
45
|
-
return false if
|
44
|
+
rescue ArgumentError => e
|
45
|
+
return false if e.message.start_with?('invalid byte sequence')
|
46
46
|
|
47
|
-
raise
|
47
|
+
raise e
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -47,8 +47,8 @@ module RuboCop
|
|
47
47
|
generate_request(uri) do |request|
|
48
48
|
begin
|
49
49
|
handle_response(http.request(request), limit, &block)
|
50
|
-
rescue SocketError =>
|
51
|
-
handle_response(
|
50
|
+
rescue SocketError => e
|
51
|
+
handle_response(e, limit, &block)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -72,10 +72,10 @@ module RuboCop
|
|
72
72
|
else
|
73
73
|
begin
|
74
74
|
response.error!
|
75
|
-
rescue StandardError =>
|
76
|
-
message = "#{
|
75
|
+
rescue StandardError => e
|
76
|
+
message = "#{e.message} while downloading remote config"\
|
77
77
|
" file #{uri}"
|
78
|
-
raise
|
78
|
+
raise e, message
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
data/lib/rubocop/result_cache.rb
CHANGED
@@ -100,9 +100,9 @@ module RuboCop
|
|
100
100
|
|
101
101
|
begin
|
102
102
|
FileUtils.mkdir_p(dir)
|
103
|
-
rescue Errno::EACCES =>
|
103
|
+
rescue Errno::EACCES => e
|
104
104
|
warn "Couldn't create cache directory. Continuing without cache."\
|
105
|
-
"\n #{
|
105
|
+
"\n #{e.message}"
|
106
106
|
return
|
107
107
|
end
|
108
108
|
|
data/lib/rubocop/runner.rb
CHANGED
@@ -108,8 +108,8 @@ module RuboCop
|
|
108
108
|
end
|
109
109
|
formatter_set.file_finished(file, offenses)
|
110
110
|
offenses
|
111
|
-
rescue InfiniteCorrectionLoop =>
|
112
|
-
formatter_set.file_finished(file,
|
111
|
+
rescue InfiniteCorrectionLoop => e
|
112
|
+
formatter_set.file_finished(file, e.offenses.compact.sort.freeze)
|
113
113
|
raise
|
114
114
|
end
|
115
115
|
|
@@ -145,12 +145,8 @@ module RuboCop
|
|
145
145
|
|
146
146
|
first_line = File.open(file, &:readline)
|
147
147
|
!(first_line =~ /#!.*(#{ruby_interpreters(file).join('|')})/).nil?
|
148
|
-
rescue EOFError, ArgumentError =>
|
149
|
-
if debug?
|
150
|
-
warn(
|
151
|
-
"Unprocessable file #{file}: #{ex.class}, #{ex.message}"
|
152
|
-
)
|
153
|
-
end
|
148
|
+
rescue EOFError, ArgumentError => e
|
149
|
+
warn("Unprocessable file #{file}: #{e.class}, #{e.message}") if debug?
|
154
150
|
|
155
151
|
false
|
156
152
|
end
|
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 = '0.67.
|
6
|
+
STRING = '0.67.1'.freeze
|
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)'.freeze
|