Merge pull request #4384 from consul/dependabot/bundler/rubocop-performance-1.10.1

Bump rubocop-performance from 1.7.1 to 1.10.1
This commit is contained in:
Javi Martín
2021-08-10 13:47:44 +02:00
committed by GitHub
8 changed files with 23 additions and 16 deletions

View File

@@ -205,6 +205,9 @@ Lint/UselessAssignment:
Lint/Void:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CompareWithBlock:
Enabled: true
@@ -217,6 +220,9 @@ Performance/EndWith:
Performance/StartWith:
Enabled: true
Performance/Sum:
Enabled: true
Rails/ActiveRecordCallbacksOrder:
Enabled: true

View File

@@ -108,7 +108,7 @@ group :development do
gem "pronto-rubocop", "~> 0.11.1", require: false
gem "pronto-scss", "~> 0.11.0", require: false
gem "rubocop", "~> 0.93.1", require: false
gem "rubocop-performance", "~> 1.7.1", require: false
gem "rubocop-performance", "~> 1.10.1", require: false
gem "rubocop-rails", "~> 2.9.1", require: false
gem "rubocop-rspec", "~> 1.44.1", require: false
gem "rvm1-capistrano3", "~> 1.4.0", require: false

View File

@@ -553,8 +553,9 @@ GEM
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.9.0)
parser (>= 3.0.1.1)
rubocop-performance (1.7.1)
rubocop (>= 0.82.0)
rubocop-performance (1.10.2)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
@@ -771,7 +772,7 @@ DEPENDENCIES
rollbar (~> 3.1.2)
rspec-rails (~> 4.0)
rubocop (~> 0.93.1)
rubocop-performance (~> 1.7.1)
rubocop-performance (~> 1.10.1)
rubocop-rails (~> 2.9.1)
rubocop-rspec (~> 1.44.1)
rvm1-capistrano3 (~> 1.4.0)

View File

@@ -17,7 +17,7 @@ module Header
end
tag.header do
safe_join([before, content_tag(heading_tag, title), (capture(&block) if block_given?)].compact)
safe_join([before, content_tag(heading_tag, title), (capture(&block) if block)].compact)
end
end

View File

@@ -54,7 +54,7 @@ class Budget::Stats
end
def total_votes
budget.ballots.pluck(:ballot_lines_count).reduce(0) { |sum, x| sum + x }
budget.ballots.pluck(:ballot_lines_count).sum
end
def total_selected_investments
@@ -72,18 +72,18 @@ class Budget::Stats
end
groups[:total] = Hash.new(0)
groups[:total][:total_investments_count] = groups.map { |_k, v| v[:total_investments_count] }.sum
groups[:total][:total_participants_support_phase] = groups.map { |_k, v| v[:total_participants_support_phase] }.sum
groups[:total][:total_participants_vote_phase] = groups.map { |_k, v| v[:total_participants_vote_phase] }.sum
groups[:total][:total_participants_every_phase] = groups.map { |_k, v| v[:total_participants_every_phase] }.sum
groups[:total][:total_investments_count] = groups.sum { |_k, v| v[:total_investments_count] }
groups[:total][:total_participants_support_phase] = groups.sum { |_k, v| v[:total_participants_support_phase] }
groups[:total][:total_participants_vote_phase] = groups.sum { |_k, v| v[:total_participants_vote_phase] }
groups[:total][:total_participants_every_phase] = groups.sum { |_k, v| v[:total_participants_every_phase] }
budget.headings.each do |heading|
groups[heading.id].merge!(calculate_heading_stats_with_totals(groups[heading.id], groups[:total], heading.population))
end
groups[:total][:percentage_participants_support_phase] = groups.map { |_k, v| v[:percentage_participants_support_phase] }.sum
groups[:total][:percentage_participants_vote_phase] = groups.map { |_k, v| v[:percentage_participants_vote_phase] }.sum
groups[:total][:percentage_participants_every_phase] = groups.map { |_k, v| v[:percentage_participants_every_phase] }.sum
groups[:total][:percentage_participants_support_phase] = groups.sum { |_k, v| v[:percentage_participants_support_phase] }
groups[:total][:percentage_participants_vote_phase] = groups.sum { |_k, v| v[:percentage_participants_vote_phase] }
groups[:total][:percentage_participants_every_phase] = groups.sum { |_k, v| v[:percentage_participants_every_phase] }
groups
end

View File

@@ -110,7 +110,7 @@ class Legislation::Process < ApplicationRecord
end
def total_comments
questions.sum(:comments_count) + draft_versions.map(&:total_comments).sum
questions.sum(:comments_count) + draft_versions.sum(&:total_comments)
end
def status

View File

@@ -18,6 +18,6 @@ module RemoteTranslations::Microsoft::SentencesParser
end
def characters_count(texts)
texts.map(&:size).reduce(:+)
texts.sum(&:size)
end
end

View File

@@ -384,7 +384,7 @@ namespace :proposal_actions do
5
]
votes_count = expected_supports.reduce(0.0) { |sum, x| sum + x }
votes_count = expected_supports.sum
goal_votes = Setting["votes_for_proposal_success"].to_f
cached_votes_up = 0