Bump rubocop from 1.56.4 to 1.61.0

This version fixes false negatives for Lint/SymbolConversion when using
string interpolation, for Style/RedundantArgument when using the safe
navigation operator, for Style/RedundantParentheses when logical
operators are involved and for Style/RedundantReturn with lambda ending
with return. We're applying the new rules.

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.4 to 1.61.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.56.4...v1.61.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-03-02 00:20:06 +00:00
committed by Javi Martín
parent e24ebf9406
commit f4203909db
13 changed files with 24 additions and 25 deletions

View File

@@ -99,7 +99,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-scss", "~> 0.11.0", 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-capybara", "~> 2.20.0", require: false
gem "rubocop-factory_bot", "~> 2.25.1", require: false gem "rubocop-factory_bot", "~> 2.25.1", require: false
gem "rubocop-performance", "~> 1.20.2", require: false gem "rubocop-performance", "~> 1.20.2", require: false

View File

@@ -526,16 +526,15 @@ 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.56.4) rubocop (1.61.0)
base64 (~> 0.1.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)
parser (>= 3.2.2.3) parser (>= 3.3.0.2)
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.28.1, < 2.0) rubocop-ast (>= 1.30.0, < 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.2) rubocop-ast (1.31.2)
@@ -758,7 +757,7 @@ DEPENDENCIES
rinku (~> 2.0.6) rinku (~> 2.0.6)
ros-apartment (~> 2.11.0) ros-apartment (~> 2.11.0)
rspec-rails (~> 6.1.2) rspec-rails (~> 6.1.2)
rubocop (~> 1.56.4) rubocop (~> 1.61.0)
rubocop-capybara (~> 2.20.0) rubocop-capybara (~> 2.20.0)
rubocop-factory_bot (~> 2.25.1) rubocop-factory_bot (~> 2.25.1)
rubocop-performance (~> 1.20.2) rubocop-performance (~> 1.20.2)

View File

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

View File

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

View File

@@ -27,7 +27,7 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
def update def update
if @process.update(process_params) if @process.update(process_params)
link = legislation_process_path(@process) 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)) notice: t("admin.legislation.processes.update.notice", link: link))
else else
flash.now[:error] = t("admin.legislation.processes.update.error") 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 def shift_params
shift_params = params.require(:shift).permit(allowed_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 end
def allowed_params def allowed_params

View File

@@ -75,7 +75,7 @@ module CommentableActions
private private
def track_event 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 end
def tag_cloud def tag_cloud

View File

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

View File

@@ -34,10 +34,10 @@ class Dashboard::Action < ApplicationRecord
scope :resources, -> { where(action_type: 1) } scope :resources, -> { where(action_type: 1) }
scope :proposed_actions, -> { where(action_type: 0) } scope :proposed_actions, -> { where(action_type: 0) }
scope :by_proposal, lambda { |proposal| scope :by_proposal, lambda { |proposal|
return where(published_proposal: false) if proposal.draft? where(published_proposal: false) if proposal.draft?
} }
scope :by_published_proposal, lambda { |published| scope :by_published_proposal, lambda { |published|
return where(published_proposal: published) where(published_proposal: published)
} }
def self.active_for(proposal) def self.active_for(proposal)

View File

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

View File

@@ -40,7 +40,7 @@ class Setting < ApplicationRecord
end end
def accepted_content_types_for(group) 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 Setting.mime_types[group].select { |_, content_type| mime_content_types.include?(content_type) }.keys
end end

View File

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

View File

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