Merge pull request #5406 from consuldemocracy/dependabot/bundler/rubocop-1.61.0

Bump rubocop from 1.56.4 to 1.61.0
This commit is contained in:
Javi Martín
2024-04-02 18:14:09 +02:00
committed by GitHub
14 changed files with 27 additions and 29 deletions

View File

@@ -767,6 +767,9 @@ Style/RedundantStringEscape:
Style/SafeNavigation:
Enabled: true
Style/SingleLineDoEndBlock:
Enabled: true
Style/SingleLineMethods:
Enabled: true

View File

@@ -99,7 +99,7 @@ group :development do
gem "pronto-eslint", "~> 0.11.1", require: false
gem "pronto-rubocop", "~> 0.11.5", require: false
gem "pronto-scss", "~> 0.11.0", require: false
gem "rubocop", "~> 1.56.4", require: false
gem "rubocop", "~> 1.61.0", require: false
gem "rubocop-capybara", "~> 2.20.0", require: false
gem "rubocop-factory_bot", "~> 2.25.1", require: false
gem "rubocop-performance", "~> 1.20.2", require: false

View File

@@ -526,16 +526,15 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.56.4)
base64 (~> 0.1.1)
rubocop (1.61.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
@@ -758,7 +757,7 @@ DEPENDENCIES
rinku (~> 2.0.6)
ros-apartment (~> 2.11.0)
rspec-rails (~> 6.1.2)
rubocop (~> 1.56.4)
rubocop (~> 1.61.0)
rubocop-capybara (~> 2.20.0)
rubocop-factory_bot (~> 2.25.1)
rubocop-performance (~> 1.20.2)

View File

@@ -64,10 +64,10 @@ class Budgets::Investments::VotesComponent < ApplicationComponent
t("votes.budget_investments.#{reason}",
count: investment.group.max_votable_headings,
verify_account: link_to_verify_account,
supported_headings: (current_user && current_user.headings_voted_within_group(investment.group)
.map(&:name)
.sort
.to_sentence))
supported_headings: current_user && current_user.headings_voted_within_group(investment.group)
.map(&:name)
.sort
.to_sentence)
end
end
end

View File

@@ -9,7 +9,7 @@ class Admin::Legislation::HomepagesController < Admin::Legislation::BaseControll
def update
if @process.update(process_params)
link = legislation_process_path(@process)
redirect_back(fallback_location: (request.referer || root_path),
redirect_back(fallback_location: request.referer || root_path,
notice: t("admin.legislation.processes.update.notice", link: link))
else
flash.now[:error] = t("admin.legislation.processes.update.error")

View File

@@ -27,7 +27,7 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
def update
if @process.update(process_params)
link = legislation_process_path(@process)
redirect_back(fallback_location: (request.referer || root_path),
redirect_back(fallback_location: request.referer || root_path,
notice: t("admin.legislation.processes.update.notice", link: link))
else
flash.now[:error] = t("admin.legislation.processes.update.error")

View File

@@ -57,7 +57,7 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController
def shift_params
shift_params = params.require(:shift).permit(allowed_params)
shift_params.merge(date: shift_params[:date]["#{shift_params[:task]}_date".to_sym])
shift_params.merge(date: shift_params[:date][:"#{shift_params[:task]}_date"])
end
def allowed_params

View File

@@ -75,7 +75,7 @@ module CommentableActions
private
def track_event
ahoy.track "#{resource_name}_created".to_sym, "#{resource_name}_id": resource.id
ahoy.track :"#{resource_name}_created", "#{resource_name}_id": resource.id
end
def tag_cloud

View File

@@ -16,7 +16,7 @@ module Documentable
end
def accepted_content_types
Setting["uploads.documents.content_types"]&.split(" ") || ["application/pdf"]
Setting["uploads.documents.content_types"]&.split || ["application/pdf"]
end
end
end

View File

@@ -33,12 +33,8 @@ class Dashboard::Action < ApplicationRecord
scope :inactive, -> { where(active: false) }
scope :resources, -> { where(action_type: 1) }
scope :proposed_actions, -> { where(action_type: 0) }
scope :by_proposal, lambda { |proposal|
return where(published_proposal: false) if proposal.draft?
}
scope :by_published_proposal, lambda { |published|
return where(published_proposal: published)
}
scope :by_proposal, ->(proposal) { where(published_proposal: false) if proposal.draft? }
scope :by_published_proposal, ->(published) { where(published_proposal: published) }
def self.active_for(proposal)
published_at = proposal.published_at&.to_date || Date.current

View File

@@ -24,7 +24,7 @@ class Image < ApplicationRecord
end
def self.accepted_content_types
Setting["uploads.images.content_types"]&.split(" ") || ["image/jpeg"]
Setting["uploads.images.content_types"]&.split || ["image/jpeg"]
end
def self.humanized_accepted_content_types

View File

@@ -40,7 +40,7 @@ class Setting < ApplicationRecord
end
def accepted_content_types_for(group)
mime_content_types = Setting["uploads.#{group}.content_types"]&.split(" ") || []
mime_content_types = Setting["uploads.#{group}.content_types"]&.split || []
Setting.mime_types[group].select { |_, content_type| mime_content_types.include?(content_type) }.keys
end

View File

@@ -18,9 +18,9 @@ module Emails
def fill_in_newsletter_form(options = {})
select (options[:segment_recipient] || "All users"), from: "Recipients"
fill_in "Subject", with: (options[:subject] || "This is a different subject")
fill_in "Subject", with: options[:subject] || "This is a different subject"
fill_in "E-mail address that will appear as sending the newsletter",
with: (options[:from] || "no-reply@consul.dev")
fill_in_ckeditor "Email content", with: (options[:body] || "This is a different body")
with: options[:from] || "no-reply@consul.dev"
fill_in_ckeditor "Email content", with: options[:body] || "This is a different body"
end
end

View File

@@ -61,8 +61,8 @@ module Notifications
def fill_in_admin_notification_form(options = {})
select (options[:segment_recipient] || "All users"), from: :admin_notification_segment_recipient
fill_in "Title", with: (options[:title] || "This is the notification title")
fill_in "Text", with: (options[:body] || "This is the notification body")
fill_in :admin_notification_link, with: (options[:link] || "https://www.decide.madrid.es/vota")
fill_in "Title", with: options[:title] || "This is the notification title"
fill_in "Text", with: options[:body] || "This is the notification body"
fill_in :admin_notification_link, with: options[:link] || "https://www.decide.madrid.es/vota"
end
end