Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build(deps-dev): Bump rubocop from 1.63.5 to 1.64.0 #8273

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .ruby-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ Layout/EmptyLineAfterGuardClause:
Layout/EmptyLineAfterMagicComment:
Enabled: true

# Prefer EmptyLinesAroundRescuedExceptions instead
Layout/EmptyLineAfterMultilineCondition:
Enabled: false # we prefer EmptyLinesAroundRescuedExceptions instead
Enabled: false

Layout/EmptyLineBetweenDefs:
Enabled: true
Expand All @@ -170,8 +171,9 @@ Layout/EmptyLinesAroundBlockBody:
Layout/EmptyLinesAroundClassBody:
Enabled: true

# Prefer EmptyLinesAroundRescuedExceptions instead
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: false # we prefer EmptyLinesAroundRescuedExceptions instead
Enabled: false

Layout/EmptyLinesAroundMethodBody:
Enabled: true
Expand Down Expand Up @@ -2128,6 +2130,9 @@ Style/Semicolon:
Style/Send:
Enabled: false

Style/SendWithLiteralMethodName:
Enabled: false

Style/SignalException:
Enabled: true
EnforcedStyle: only_raise
Expand Down Expand Up @@ -2198,6 +2203,9 @@ Style/Strip:
Style/StructInheritance:
Enabled: true

Style/SuperArguments:
Enabled: false

Style/SuperWithArgsParentheses:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ group :development do
gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0'
gem 'launchy', '< 3.1.0'
gem 'web-console', '>= 3.3.0'
gem 'rubocop', '~> 1.63.5', require: false
gem 'rubocop', '~> 1.64.0', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
end
12 changes: 7 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.5)
racc (1.7.3)
racc (1.8.0)
rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
Expand Down Expand Up @@ -435,15 +435,16 @@ GEM
redis (4.8.1)
redlock (1.3.2)
redis (>= 3.0.0, < 6.0)
regexp_parser (2.9.1)
regexp_parser (2.9.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
request_store (1.5.1)
rack (>= 1.4)
retriable (3.1.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rolify (6.0.1)
rotp (6.3.0)
rspec-activemodel-mocks (1.2.0)
Expand All @@ -467,7 +468,7 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.63.5)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -527,6 +528,7 @@ GEM
sprockets (>= 3.0.0)
statistics2 (0.54)
stripe (5.55.0)
strscan (3.1.0)
syck (1.4.1)
syslog_protocol (0.9.2)
text (1.3.1)
Expand Down Expand Up @@ -646,7 +648,7 @@ DEPENDENCIES
rolify (~> 6.0.1)
rspec-activemodel-mocks (~> 1.2.0)
rspec-rails (~> 6.1.2)
rubocop (~> 1.63.5)
rubocop (~> 1.64.0)
rubocop-performance
rubocop-rails
ruby-msg (~> 1.5.0)!
Expand Down
25 changes: 23 additions & 2 deletions script/update-rubocop-config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def groupings_from_config(config)
cops_from_config(config).map { |c| c.split('/').first }.uniq
end

def write_config(config)
def write_config(config, comments)
yaml = config.sort.to_h.to_yaml

# add lines between cops
Expand All @@ -98,9 +98,30 @@ def write_config(config)
yaml.sub!(g + '/', '#' * 20 + " #{g} " + '#' * 20 + "\n\n#{g}/")
end

comments.each do |cop, comment_lines|
yaml.gsub!(/^(#{cop}:)/, "#{comment_lines.join("\n")}\n\\1")
end

File.write(CONFIG_FILE, yaml)
end

write_config(merge_config(default_config, current_config))
def cop_comments
comments = {}
current_section = []

File.readlines(CONFIG_FILE).each do |line|
if line.match?('^(# .*|#)$')
current_section << line.strip
elsif !current_section.empty? && line.match?(/^\w/)
cop_name = line.split(':').first
comments[cop_name] = current_section
current_section = []
end
end

comments
end

write_config(merge_config(default_config, current_config), cop_comments)
puts "RuboCop configuration at #{File.expand_path(CONFIG_FILE)} has been updated"
puts "Please manually check cops which have been renamed"
Loading