Merge pull request #5564 from consuldemocracy/dependabot/bundler/rubocop-1.64.1

Bump rubocop from 1.61.0 to 1.64.1
This commit is contained in:
Javi Martín
2024-07-21 22:21:33 +02:00
committed by GitHub
9 changed files with 22 additions and 20 deletions

View File

@@ -715,6 +715,9 @@ Style/InvertibleUnlessCondition:
Style/LineEndConcatenation: Style/LineEndConcatenation:
Enabled: true Enabled: true
Style/MapIntoArray:
Enabled: true
Style/MapToHash: Style/MapToHash:
Enabled: true Enabled: true
@@ -793,6 +796,11 @@ Style/StringLiterals:
Style/StringLiteralsInInterpolation: Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes EnforcedStyle: double_quotes
Style/SuperArguments:
Enabled: true
Exclude:
- "config/initializers/ahoy.rb"
Style/SymbolProc: Style/SymbolProc:
Enabled: true Enabled: true
AllowedMethods: AllowedMethods:

View File

@@ -98,7 +98,7 @@ group :development do
gem "pronto-eslint", "~> 0.11.1", require: false gem "pronto-eslint", "~> 0.11.1", require: false
gem "pronto-rubocop", "~> 0.11.5", require: false gem "pronto-rubocop", "~> 0.11.5", require: false
gem "pronto-stylelint", "~> 0.10.3", require: false gem "pronto-stylelint", "~> 0.10.3", require: false
gem "rubocop", "~> 1.61.0", require: false gem "rubocop", "~> 1.64.1", require: false
gem "rubocop-capybara", "~> 2.21.0", require: false gem "rubocop-capybara", "~> 2.21.0", require: false
gem "rubocop-factory_bot", "~> 2.26.1", require: false gem "rubocop-factory_bot", "~> 2.26.1", require: false
gem "rubocop-performance", "~> 1.21.1", require: false gem "rubocop-performance", "~> 1.21.1", require: false

View File

@@ -536,7 +536,7 @@ GEM
rspec-mocks (~> 3.13) rspec-mocks (~> 3.13)
rspec-support (~> 3.13) rspec-support (~> 3.13)
rspec-support (3.13.1) rspec-support (3.13.1)
rubocop (1.61.0) rubocop (1.64.1)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (>= 3.17.0)
parallel (~> 1.10) parallel (~> 1.10)
@@ -544,7 +544,7 @@ GEM
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0) rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3) rubocop-ast (1.31.3)
@@ -765,7 +765,7 @@ DEPENDENCIES
rinku (~> 2.0.6) rinku (~> 2.0.6)
ros-apartment (~> 2.11.0) ros-apartment (~> 2.11.0)
rspec-rails (~> 6.1.3) rspec-rails (~> 6.1.3)
rubocop (~> 1.61.0) rubocop (~> 1.64.1)
rubocop-capybara (~> 2.21.0) rubocop-capybara (~> 2.21.0)
rubocop-factory_bot (~> 2.26.1) rubocop-factory_bot (~> 2.26.1)
rubocop-performance (~> 1.21.1) rubocop-performance (~> 1.21.1)

View File

@@ -19,7 +19,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
if resource.registering_with_oauth if resource.registering_with_oauth
finish_signup_path finish_signup_path
else else
super(resource) super
end end
end end

View File

@@ -1,7 +1,7 @@
module Types module Types
class BaseObject < GraphQL::Schema::Object class BaseObject < GraphQL::Schema::Object
def self.field(*args, **kwargs, &) def self.field(*args, **kwargs, &)
super(*args, **kwargs, &) super
# The old api contained non-camelized fields # The old api contained non-camelized fields
# We want to support these for now, but throw a deprecation warning # We want to support these for now, but throw a deprecation warning
@@ -13,8 +13,7 @@ module Types
if field_name.to_s.include?("_") if field_name.to_s.include?("_")
reason = "Snake case fields are deprecated. Please use #{field_name.to_s.camelize(:lower)}." reason = "Snake case fields are deprecated. Please use #{field_name.to_s.camelize(:lower)}."
kwargs = kwargs.merge({ camelize: false, deprecation_reason: reason }) super(*args, **kwargs.merge({ camelize: false, deprecation_reason: reason }), &)
super(*args, **kwargs, &)
end end
# Make sure associations only return public records # Make sure associations only return public records

View File

@@ -1,8 +1,7 @@
module OfficingHelper module OfficingHelper
def booths_for_officer_select_options(officer_assignments) def booths_for_officer_select_options(officer_assignments)
options = [] options = officer_assignments.map do |oa|
officer_assignments.each do |oa| [oa.booth_assignment.booth.name.to_s, oa.id]
options << [oa.booth_assignment.booth.name.to_s, oa.id]
end end
options.sort_by! { |x| x[0] } options.sort_by! { |x| x[0] }
options_for_select(options, params[:oa]) options_for_select(options, params[:oa])

View File

@@ -27,7 +27,7 @@ module ActsAsParanoidAliases
def restore(opts = {}) def restore(opts = {})
return false unless hidden? return false unless hidden?
super(opts) super
update_attribute(:confirmed_hide_at, nil) if self.class.column_names.include? "confirmed_hide_at" update_attribute(:confirmed_hide_at, nil) if self.class.column_names.include? "confirmed_hide_at"
after_restore after_restore
end end

View File

@@ -5,8 +5,6 @@ class DeviseMailer < Devise::Mailer
protected protected
def devise_mail(record, action, opts = {}) def devise_mail(record, action, opts = {})
I18n.with_locale record.locale do I18n.with_locale(record.locale) { super }
super(record, action, opts)
end
end end
end end

View File

@@ -191,14 +191,12 @@ class MachineLearning
end end
def scripts_info def scripts_info
scripts_info = [] Dir[SCRIPTS_FOLDER.join("*.py")].map do |full_path_filename|
Dir[SCRIPTS_FOLDER.join("*.py")].each do |full_path_filename| {
scripts_info << {
name: full_path_filename.split("/").last, name: full_path_filename.split("/").last,
description: description_from(full_path_filename) description: description_from(full_path_filename)
} }
end end.sort_by { |script_info| script_info[:name] }
scripts_info.sort_by { |script_info| script_info[:name] }
end end
def description_from(script_filename) def description_from(script_filename)