rubocop 1.63.3 → 1.63.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/style/redundant_line_continuation.rb +3 -1
- data/lib/rubocop/lockfile.rb +13 -1
- data/lib/rubocop/lsp/routes.rb +1 -3
- data/lib/rubocop/options.rb +3 -3
- 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: 2ab31c2b6de065412f4c0afc266d9bd51faee5cd9484b4d1e946e11a73b541ce
|
4
|
+
data.tar.gz: 96790c810a69221d562ddf61c7de5745b7caad26ac626f68db05fadb11889c21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d9a25c6992dc1c13fe2ed1118f3bdb6bea50e5bbeaf929c5efffc2bba444a0a2c00a9bff0ea9cc606015be873d3ff7a8dc228f823d55b5c59d763111a2c998d
|
7
|
+
data.tar.gz: 25651a0fb7709f6842a5451310f64033cd5080f8af99dfb2c587b726970d56dcb1473fcbce810867a1a5fc06d787977977508dadd5f7cd9d678e4e925b8b7761
|
@@ -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
|
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
|
data/lib/rubocop/lsp/routes.rb
CHANGED
@@ -73,9 +73,7 @@ module RuboCop
|
|
73
73
|
end
|
74
74
|
|
75
75
|
handle 'textDocument/diagnostic' do |request|
|
76
|
-
|
77
|
-
result = diagnostic(doc[:uri], doc[:text])
|
78
|
-
@server.write(result)
|
76
|
+
# no-op, diagnostics are handled in textDocument/didChange
|
79
77
|
end
|
80
78
|
|
81
79
|
handle 'textDocument/didChange' do |request|
|
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/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.4'
|
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.4
|
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-04-
|
13
|
+
date: 2024-04-28 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.4
|
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
|