Merge pull request #6006 from consuldemocracy/dependabot/bundler/rubocop-1.75.8
Bump rubocop from 1.71.2 to 1.76.1
This commit is contained in:
17
.rubocop.yml
17
.rubocop.yml
@@ -354,6 +354,14 @@ Naming/BlockForwarding:
|
|||||||
- "app/controllers/management/base_controller.rb"
|
- "app/controllers/management/base_controller.rb"
|
||||||
- "app/controllers/subscriptions_controller.rb"
|
- "app/controllers/subscriptions_controller.rb"
|
||||||
|
|
||||||
|
Naming/PredicateMethod:
|
||||||
|
Enabled: true
|
||||||
|
Exclude:
|
||||||
|
- "app/models/local_census_records/import.rb"
|
||||||
|
- "app/models/user.rb"
|
||||||
|
- "app/models/verification/management/email.rb"
|
||||||
|
- "config/initializers/foundation_form_builder.rb"
|
||||||
|
|
||||||
Naming/RescuedExceptionsVariableName:
|
Naming/RescuedExceptionsVariableName:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
@@ -725,9 +733,15 @@ Style/ClassVars:
|
|||||||
Style/CollectionMethods:
|
Style/CollectionMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/ComparableBetween:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/DigChain:
|
Style/DigChain:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/EmptyStringInsideInterpolation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/FileRead:
|
Style/FileRead:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
@@ -811,6 +825,9 @@ Style/RaiseArgs:
|
|||||||
Style/RedundantArgument:
|
Style/RedundantArgument:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/RedundantArrayFlatten:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/RedundantBegin:
|
Style/RedundantBegin:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
2
Gemfile
2
Gemfile
@@ -100,7 +100,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.6", require: false
|
gem "pronto-rubocop", "~> 0.11.6", require: false
|
||||||
gem "pronto-stylelint", "~> 0.11.1", 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-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.23.1", require: false
|
gem "rubocop-performance", "~> 1.23.1", require: false
|
||||||
|
|||||||
20
Gemfile.lock
20
Gemfile.lock
@@ -337,7 +337,7 @@ GEM
|
|||||||
rexml
|
rexml
|
||||||
kramdown-parser-gfm (1.1.0)
|
kramdown-parser-gfm (1.1.0)
|
||||||
kramdown (~> 2.0)
|
kramdown (~> 2.0)
|
||||||
language_server-protocol (3.17.0.4)
|
language_server-protocol (3.17.0.5)
|
||||||
launchy (3.1.1)
|
launchy (3.1.1)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
childprocess (~> 5.0)
|
childprocess (~> 5.0)
|
||||||
@@ -349,6 +349,7 @@ GEM
|
|||||||
letter_opener (~> 1.9)
|
letter_opener (~> 1.9)
|
||||||
railties (>= 6.1)
|
railties (>= 6.1)
|
||||||
rexml
|
rexml
|
||||||
|
lint_roller (1.1.0)
|
||||||
logger (1.7.0)
|
logger (1.7.0)
|
||||||
loofah (2.24.0)
|
loofah (2.24.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
@@ -444,7 +445,7 @@ GEM
|
|||||||
rack
|
rack
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
ostruct (0.6.1)
|
ostruct (0.6.1)
|
||||||
parallel (1.26.3)
|
parallel (1.27.0)
|
||||||
paranoia (3.0.1)
|
paranoia (3.0.1)
|
||||||
activerecord (>= 6, < 8.1)
|
activerecord (>= 6, < 8.1)
|
||||||
parser (3.3.8.0)
|
parser (3.3.8.0)
|
||||||
@@ -460,6 +461,7 @@ GEM
|
|||||||
pg_search (2.3.7)
|
pg_search (2.3.7)
|
||||||
activerecord (>= 6.1)
|
activerecord (>= 6.1)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
|
prism (1.4.0)
|
||||||
pronto (0.11.4)
|
pronto (0.11.4)
|
||||||
gitlab (>= 4.4.0, < 5.0)
|
gitlab (>= 4.4.0, < 5.0)
|
||||||
httparty (>= 0.13.7, < 1.0)
|
httparty (>= 0.13.7, < 1.0)
|
||||||
@@ -574,18 +576,20 @@ GEM
|
|||||||
rspec-mocks (~> 3.13)
|
rspec-mocks (~> 3.13)
|
||||||
rspec-support (~> 3.13)
|
rspec-support (~> 3.13)
|
||||||
rspec-support (3.13.2)
|
rspec-support (3.13.2)
|
||||||
rubocop (1.71.2)
|
rubocop (1.76.1)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (>= 3.17.0)
|
language_server-protocol (~> 3.17.0.2)
|
||||||
|
lint_roller (~> 1.1.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.3.0.2)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 2.9.3, < 3.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)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 4.0)
|
unicode-display_width (>= 2.4.0, < 4.0)
|
||||||
rubocop-ast (1.38.1)
|
rubocop-ast (1.45.1)
|
||||||
parser (>= 3.3.1.0)
|
parser (>= 3.3.7.2)
|
||||||
|
prism (~> 1.4)
|
||||||
rubocop-capybara (2.21.0)
|
rubocop-capybara (2.21.0)
|
||||||
rubocop (~> 1.41)
|
rubocop (~> 1.41)
|
||||||
rubocop-factory_bot (2.26.1)
|
rubocop-factory_bot (2.26.1)
|
||||||
@@ -811,7 +815,7 @@ DEPENDENCIES
|
|||||||
rinku (~> 2.0.6)
|
rinku (~> 2.0.6)
|
||||||
ros-apartment (~> 3.2.0)
|
ros-apartment (~> 3.2.0)
|
||||||
rspec-rails (~> 7.1.1)
|
rspec-rails (~> 7.1.1)
|
||||||
rubocop (~> 1.71.2)
|
rubocop (~> 1.76.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.23.1)
|
rubocop-performance (~> 1.23.1)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Admin::Poll::Shifts::FormComponent < ApplicationComponent
|
|||||||
def shift_vote_collection_dates
|
def shift_vote_collection_dates
|
||||||
return [] if voting_polls.blank?
|
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
|
end
|
||||||
|
|
||||||
def shift_recount_scrutiny_dates
|
def shift_recount_scrutiny_dates
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<% group.headings.sort_by_name.each do |heading| %>
|
<% group.headings.sort_by_name.each do |heading| %>
|
||||||
<li class="heading">
|
<li class="heading">
|
||||||
<%= link_to_unless(
|
<%= link_to_unless(
|
||||||
(budget.informing? || budget.finished?),
|
budget.informing? || budget.finished?,
|
||||||
heading.name,
|
heading.name,
|
||||||
budget_investments_path(budget.id, heading_id: heading.id)
|
budget_investments_path(budget.id, heading_id: heading.id)
|
||||||
) %>
|
) %>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<p><%= t("sdg.goals.help.description") %></p>
|
<p><%= t("sdg.goals.help.description") %></p>
|
||||||
<ul class="tabs" id="help_tabs" data-deep-link="true" data-tabs>
|
<ul class="tabs" id="help_tabs" data-deep-link="true" data-tabs>
|
||||||
<% goals.each do |goal| %>
|
<% goals.each do |goal| %>
|
||||||
<li class="tabs-title <%= is_active?(goal) %>">
|
<li class="tabs-title <%= active_class(goal) %>">
|
||||||
<%= link_to "#goal_#{goal.code}_tab" do %>
|
<%= link_to "#goal_#{goal.code}_tab" do %>
|
||||||
<% render SDG::Goals::IconComponent.new(goal) %>
|
<% render SDG::Goals::IconComponent.new(goal) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="tabs-content" data-tabs-content="help_tabs">
|
<div class="tabs-content" data-tabs-content="help_tabs">
|
||||||
<% goals.each do |goal| %>
|
<% goals.each do |goal| %>
|
||||||
<div id="goal_<%= goal.code %>_tab" class="tabs-panel <%= is_active?(goal) %>">
|
<div id="goal_<%= goal.code %>_tab" class="tabs-panel <%= active_class(goal) %>">
|
||||||
<h2><%= goal.code_and_title %></h2>
|
<h2><%= goal.code_and_title %></h2>
|
||||||
<p><%= sanitize t("sdg.goals.goal_#{goal.code}.description") %></p>
|
<p><%= sanitize t("sdg.goals.goal_#{goal.code}.description") %></p>
|
||||||
<%= render SDG::Goals::TargetsComponent.new(goal) %>
|
<%= render SDG::Goals::TargetsComponent.new(goal) %>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SDG::Goals::HelpPageComponent < ApplicationComponent
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def is_active?(goal)
|
def active_class(goal)
|
||||||
"is-active" if goal.code == 1
|
"is-active" if goal.code == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ class Shared::VoteButtonComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
|
|
||||||
def vote
|
def vote
|
||||||
@vote ||= Vote.find_or_initialize_by(votable: votable, voter: current_user, vote_flag: parsed_value)
|
@vote ||= Vote.find_or_initialize_by(votable: votable, voter: current_user, vote_flag: in_favor?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def already_voted?
|
def already_voted?
|
||||||
vote.persisted?
|
vote.persisted?
|
||||||
end
|
end
|
||||||
|
|
||||||
def parsed_value
|
def in_favor?
|
||||||
value == "yes"
|
value == "yes"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -79,6 +79,6 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def set_official_position
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ module ProposalsDashboardHelper
|
|||||||
dashboard_action&.proposed_action?
|
dashboard_action&.proposed_action?
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_request_active(id)
|
def request_active?(id)
|
||||||
controller_name == "dashboard" && action_name == "new_request" && dashboard_action&.id == id
|
controller_name == "dashboard" && action_name == "new_request" && dashboard_action&.id == id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ManagerAuthenticator
|
|||||||
message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }}
|
message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }}
|
||||||
).body
|
).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"]
|
@manager[:login] == parsed_response["USUARIO"]["LOGIN"]
|
||||||
rescue
|
rescue
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class Poll < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def current?(timestamp = Time.current)
|
def current?(timestamp = Time.current)
|
||||||
starts_at <= timestamp && timestamp <= ends_at
|
timestamp.between?(starts_at, ends_at)
|
||||||
end
|
end
|
||||||
|
|
||||||
def expired?(timestamp = Time.current)
|
def expired?(timestamp = Time.current)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Poll::Question::Option < ApplicationRecord
|
|||||||
|
|
||||||
def self.order_options(ordered_array)
|
def self.order_options(ordered_array)
|
||||||
ordered_array.each_with_index do |option_id, order|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ class User < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show_welcome_screen?
|
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?
|
sign_in_count == 1 && verification && !organization && !administrator?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
<% resources.each do |resource| %>
|
<% resources.each do |resource| %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to new_request_proposal_dashboard_action_path(proposal, resource),
|
<%= link_to new_request_proposal_dashboard_action_path(proposal, resource),
|
||||||
class: ("submenu-active" if is_request_active(resource.id)) do %>
|
class: ("submenu-active" if request_active?(resource.id)) do %>
|
||||||
<span data-tooltip title="<%= resource.short_description %>">
|
<span data-tooltip title="<%= resource.short_description %>">
|
||||||
<%= resource.title %>
|
<%= resource.title %>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -53,16 +53,16 @@ Rails.application.configure do
|
|||||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
config.log_formatter = ::Logger::Formatter.new
|
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
|
# Log to STDOUT if enabled
|
||||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||||
config.logger = ActiveSupport::Logger.new(STDOUT)
|
config.logger = ActiveSupport::Logger.new(STDOUT)
|
||||||
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
||||||
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
.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
|
end
|
||||||
|
|
||||||
# Prepend all log lines with the following tags.
|
# Prepend all log lines with the following tags.
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ describe ProgressBar do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "dynamically validates the percentage range" do
|
it "dynamically validates the percentage range" do
|
||||||
stub_const("#{ProgressBar}::RANGE", (-99..99))
|
stub_const("#{ProgressBar}::RANGE", -99..99)
|
||||||
|
|
||||||
progress_bar.percentage = -99
|
progress_bar.percentage = -99
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ describe "Legislation Proposals" do
|
|||||||
|
|
||||||
create_list(
|
create_list(
|
||||||
:legislation_proposal,
|
:legislation_proposal,
|
||||||
(Legislation::Proposal.default_per_page + 2),
|
Legislation::Proposal.default_per_page + 2,
|
||||||
process: process
|
process: process
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user