Skip to content

Commit ebed18e

Browse files
committed
Bump rubocop from 1.67.0 to 1.75.6
1 parent f722f39 commit ebed18e

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ group :development, :test do
3737
# environment is development
3838
gem 'rspec-rails'
3939
gem 'rspec-rerun'
40-
# Required during CI as well local development - pinned due to CI failure on: rubocop-1.73.2/lib/rubocop/config_loader.rb:272:in `read'
41-
gem 'rubocop', '1.67.0'
40+
# Required during CI as well local development
41+
gem 'rubocop', '1.75.6'
4242
end
4343

4444
group :test do

Gemfile.lock

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ GEM
170170
rspec-expectations (~> 3.12)
171171
arel-helpers (2.16.0)
172172
activerecord (>= 3.1.0, < 8.1)
173-
ast (2.4.2)
173+
ast (2.4.3)
174174
aws-eventstream (1.3.2)
175175
aws-partitions (1.1065.0)
176176
aws-sdk-core (3.220.1)
@@ -293,7 +293,8 @@ GEM
293293
jsobfu (0.4.2)
294294
rkelly-remix
295295
json (2.10.2)
296-
language_server-protocol (3.17.0.4)
296+
language_server-protocol (3.17.0.5)
297+
lint_roller (1.1.0)
297298
little-plugger (1.1.4)
298299
logger (1.6.6)
299300
logging (2.4.0)
@@ -377,8 +378,8 @@ GEM
377378
ostruct (0.6.1)
378379
packetfu (2.0.0)
379380
pcaprub (~> 0.13.1)
380-
parallel (1.26.3)
381-
parser (3.3.7.1)
381+
parallel (1.27.0)
382+
parser (3.3.8.0)
382383
ast (~> 2.4.1)
383384
racc
384385
patch_finder (1.0.2)
@@ -390,6 +391,7 @@ GEM
390391
ruby-rc4
391392
ttfunk
392393
pg (1.5.9)
394+
prism (1.4.0)
393395
pry (0.14.2)
394396
coderay (~> 1.1)
395397
method_source (~> 1.0)
@@ -517,18 +519,20 @@ GEM
517519
rspec-rerun (1.1.0)
518520
rspec (~> 3.0)
519521
rspec-support (3.13.2)
520-
rubocop (1.67.0)
522+
rubocop (1.75.6)
521523
json (~> 2.3)
522-
language_server-protocol (>= 3.17.0)
524+
language_server-protocol (~> 3.17.0.2)
525+
lint_roller (~> 1.1.0)
523526
parallel (~> 1.10)
524527
parser (>= 3.3.0.2)
525528
rainbow (>= 2.2.2, < 4.0)
526-
regexp_parser (>= 2.4, < 3.0)
527-
rubocop-ast (>= 1.32.2, < 2.0)
529+
regexp_parser (>= 2.9.3, < 3.0)
530+
rubocop-ast (>= 1.44.0, < 2.0)
528531
ruby-progressbar (~> 1.7)
529-
unicode-display_width (>= 2.4.0, < 3.0)
530-
rubocop-ast (1.38.1)
531-
parser (>= 3.3.1.0)
532+
unicode-display_width (>= 2.4.0, < 4.0)
533+
rubocop-ast (1.44.1)
534+
parser (>= 3.3.7.2)
535+
prism (~> 1.4)
532536
ruby-macho (4.1.0)
533537
ruby-mysql (4.2.0)
534538
ruby-prof (1.7.1)
@@ -578,7 +582,9 @@ GEM
578582
concurrent-ruby (~> 1.0)
579583
tzinfo-data (1.2025.1)
580584
tzinfo (>= 1.0.0)
581-
unicode-display_width (2.6.0)
585+
unicode-display_width (3.1.4)
586+
unicode-emoji (~> 4.0, >= 4.0.4)
587+
unicode-emoji (4.0.4)
582588
unix-crypt (1.3.1)
583589
warden (1.2.9)
584590
rack (>= 2.0.9)
@@ -623,7 +629,7 @@ DEPENDENCIES
623629
redcarpet
624630
rspec-rails
625631
rspec-rerun
626-
rubocop (= 1.67.0)
632+
rubocop (= 1.75.6)
627633
ruby-prof
628634
simplecov (= 0.18.2)
629635
test-prof

spec/spec_helper.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212
require 'rubocop/rspec/support'
1313
require 'faker'
1414

15+
# Monkey patch rubocop which fails to load the default rspec config due to encoding issues - https://github.com/rapid7/metasploit-framework/pull/20196
16+
# Caused by our global IO encoding being set to ASCII-8BIT - https://github.com/rapid7/metasploit-framework/blob/b251fc1b635dc07c66cc3848983bdcbeaa08a81f/lib/metasploit/framework/common_engine.rb#L25-L33
17+
# Original code: https://github.com/rubocop/rubocop/blob/b6c9b0ed31daf40be5a273714095e451aee10bcd/lib/rubocop/config_loader.rb#L275
18+
# Character which causes encoding failure: https://github.com/rubocop/rubocop/blob/b6c9b0ed31daf40be5a273714095e451aee10bcd/config/default.yml#L3298-L3305
19+
module RuboCop
20+
class ConfigLoader
21+
# Read the specified file, or exit with a friendly, concise message on
22+
# stderr. Care is taken to use the standard OS exit code for a "file not
23+
# found" error.
24+
def self.read_file(absolute_path)
25+
File.binread(absolute_path).force_encoding(Encoding::UTF_8)
26+
rescue Errno::ENOENT
27+
raise ConfigNotFoundError, "Configuration file not found: #{absolute_path}"
28+
end
29+
end
30+
end
31+
1532
ENV['RAILS_ENV'] = 'test'
1633

1734
load_metasploit = ENV.fetch('SPEC_HELPER_LOAD_METASPLOIT', 'true') == 'true'

0 commit comments

Comments
 (0)