From 123c97771a8469386a7b8086e9715a7344c1971e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 13:49:07 +0000 Subject: [PATCH] Bump rubocop from 1.71.2 to 1.75.8 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.71.2 to 1.75.8. - [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.71.2...v1.75.8) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.75.8 dependency-type: direct:development update-type: version-update:semver-minor ... Notes: This commit also includes several style and lint fixes required after updating RuboCop: - Removed redundant parentheses now detected by improved 'Style/RedundantParentheses' (1.72 and 1.75.3). - Replaced ternary expressions with logical OR when the ternary was returning 'true', as flagged by 'Style/RedundantCondition' (1.73). - Adjusted block variables to resolve new 'Lint/ShadowingOuterLocalVariable' offenses (1.75), helping avoid future conflicts during upgrades with 'rails app:updates' Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 20 +++++++++++-------- .../admin/poll/shifts/form_component.rb | 2 +- .../groups_and_headings_component.html.erb | 2 +- .../users/confirmations_controller.rb | 2 +- app/lib/manager_authenticator.rb | 2 +- app/models/poll/question/option.rb | 2 +- app/models/user.rb | 2 +- config/environments/production.rb | 10 +++++----- spec/models/progress_bar_spec.rb | 2 +- spec/system/legislation/proposals_spec.rb | 2 +- 11 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index 96bbd27cc..e361f6046 100644 --- a/Gemfile +++ b/Gemfile @@ -100,7 +100,7 @@ group :development do gem "pronto-eslint", "~> 0.11.1", require: false gem "pronto-rubocop", "~> 0.11.6", require: false gem "pronto-stylelint", "~> 0.11.1", require: false - gem "rubocop", "~> 1.71.2", require: false + gem "rubocop", "~> 1.76.1", require: false gem "rubocop-capybara", "~> 2.21.0", require: false gem "rubocop-factory_bot", "~> 2.26.1", require: false gem "rubocop-performance", "~> 1.23.1", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 12690955b..90fe29816 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -337,7 +337,7 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) launchy (3.1.1) addressable (~> 2.8) childprocess (~> 5.0) @@ -349,6 +349,7 @@ GEM letter_opener (~> 1.9) railties (>= 6.1) rexml + lint_roller (1.1.0) logger (1.7.0) loofah (2.24.0) crass (~> 1.0.2) @@ -444,7 +445,7 @@ GEM rack orm_adapter (0.5.0) ostruct (0.6.1) - parallel (1.26.3) + parallel (1.27.0) paranoia (3.0.1) activerecord (>= 6, < 8.1) parser (3.3.8.0) @@ -460,6 +461,7 @@ GEM pg_search (2.3.7) activerecord (>= 6.1) activesupport (>= 6.1) + prism (1.4.0) pronto (0.11.4) gitlab (>= 4.4.0, < 5.0) httparty (>= 0.13.7, < 1.0) @@ -574,18 +576,20 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.2) - rubocop (1.71.2) + rubocop (1.76.1) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.45.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) + rubocop-ast (1.45.1) + parser (>= 3.3.7.2) + prism (~> 1.4) rubocop-capybara (2.21.0) rubocop (~> 1.41) rubocop-factory_bot (2.26.1) @@ -811,7 +815,7 @@ DEPENDENCIES rinku (~> 2.0.6) ros-apartment (~> 3.2.0) rspec-rails (~> 7.1.1) - rubocop (~> 1.71.2) + rubocop (~> 1.76.1) rubocop-capybara (~> 2.21.0) rubocop-factory_bot (~> 2.26.1) rubocop-performance (~> 1.23.1) diff --git a/app/components/admin/poll/shifts/form_component.rb b/app/components/admin/poll/shifts/form_component.rb index 5a0c626ba..8bdcf7bf2 100644 --- a/app/components/admin/poll/shifts/form_component.rb +++ b/app/components/admin/poll/shifts/form_component.rb @@ -20,7 +20,7 @@ class Admin::Poll::Shifts::FormComponent < ApplicationComponent def shift_vote_collection_dates return [] if voting_polls.blank? - date_options((voting_start_date..voting_end_date), Poll::Shift.tasks[:vote_collection]) + date_options(voting_start_date..voting_end_date, Poll::Shift.tasks[:vote_collection]) end def shift_recount_scrutiny_dates diff --git a/app/components/budgets/groups_and_headings_component.html.erb b/app/components/budgets/groups_and_headings_component.html.erb index 6f44960dd..a10282aa7 100644 --- a/app/components/budgets/groups_and_headings_component.html.erb +++ b/app/components/budgets/groups_and_headings_component.html.erb @@ -5,7 +5,7 @@ <% group.headings.sort_by_name.each do |heading| %>
  • <%= link_to_unless( - (budget.informing? || budget.finished?), + budget.informing? || budget.finished?, heading.name, budget_investments_path(budget.id, heading_id: heading.id) ) %> diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb index 80b0c49ff..2a7897f70 100644 --- a/app/controllers/users/confirmations_controller.rb +++ b/app/controllers/users/confirmations_controller.rb @@ -79,6 +79,6 @@ class Users::ConfirmationsController < Devise::ConfirmationsController private def set_official_position - resource.add_official_position! (Setting["official_level_1_name"]), 1 + resource.add_official_position!(Setting["official_level_1_name"], 1) end end diff --git a/app/lib/manager_authenticator.rb b/app/lib/manager_authenticator.rb index d0521aa96..ae1a4e1ea 100644 --- a/app/lib/manager_authenticator.rb +++ b/app/lib/manager_authenticator.rb @@ -22,7 +22,7 @@ class ManagerAuthenticator message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }} ).body - parsed_response = parser.parse((response[:get_status_user_data_response][:get_status_user_data_return])) + parsed_response = parser.parse(response[:get_status_user_data_response][:get_status_user_data_return]) @manager[:login] == parsed_response["USUARIO"]["LOGIN"] rescue false diff --git a/app/models/poll/question/option.rb b/app/models/poll/question/option.rb index 299e764bb..9de143c06 100644 --- a/app/models/poll/question/option.rb +++ b/app/models/poll/question/option.rb @@ -30,7 +30,7 @@ class Poll::Question::Option < ApplicationRecord def self.order_options(ordered_array) ordered_array.each_with_index do |option_id, order| - find(option_id).update_column(:given_order, (order + 1)) + find(option_id).update_column(:given_order, order + 1) end end diff --git a/app/models/user.rb b/app/models/user.rb index 4f71af75a..970cc8312 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -325,7 +325,7 @@ class User < ApplicationRecord end def show_welcome_screen? - verification = Setting["feature.user.skip_verification"].present? ? true : unverified? + verification = Setting["feature.user.skip_verification"].present? || unverified? sign_in_count == 1 && verification && !organization && !administrator? end diff --git a/config/environments/production.rb b/config/environments/production.rb index f45a9aa76..7a2147f7a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -53,16 +53,16 @@ Rails.application.configure do # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new - # Rotate logger - logger = ActiveSupport::Logger.new(config.default_log_file, "daily") - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - # Log to STDOUT if enabled if ENV["RAILS_LOG_TO_STDOUT"].present? config.logger = ActiveSupport::Logger.new(STDOUT) .tap { |logger| logger.formatter = ::Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + else + # Rotate logger + config.logger = ActiveSupport::Logger.new(config.default_log_file, "daily") + .tap { |logger| logger.formatter = config.log_formatter } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } end # Prepend all log lines with the following tags. diff --git a/spec/models/progress_bar_spec.rb b/spec/models/progress_bar_spec.rb index f0efbbcbd..319c71fd4 100644 --- a/spec/models/progress_bar_spec.rb +++ b/spec/models/progress_bar_spec.rb @@ -65,7 +65,7 @@ describe ProgressBar do end it "dynamically validates the percentage range" do - stub_const("#{ProgressBar}::RANGE", (-99..99)) + stub_const("#{ProgressBar}::RANGE", -99..99) progress_bar.percentage = -99 diff --git a/spec/system/legislation/proposals_spec.rb b/spec/system/legislation/proposals_spec.rb index c71e4c322..fd89cbba1 100644 --- a/spec/system/legislation/proposals_spec.rb +++ b/spec/system/legislation/proposals_spec.rb @@ -27,7 +27,7 @@ describe "Legislation Proposals" do create_list( :legislation_proposal, - (Legislation::Proposal.default_per_page + 2), + Legislation::Proposal.default_per_page + 2, process: process ) end