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:
@@ -205,6 +205,9 @@ Lint/UselessAssignment:
|
|||||||
Lint/Void:
|
Lint/Void:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Performance/BlockGivenWithExplicitBlock:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Performance/CompareWithBlock:
|
Performance/CompareWithBlock:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
@@ -217,6 +220,9 @@ Performance/EndWith:
|
|||||||
Performance/StartWith:
|
Performance/StartWith:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Performance/Sum:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/ActiveRecordCallbacksOrder:
|
Rails/ActiveRecordCallbacksOrder:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
2
Gemfile
2
Gemfile
@@ -108,7 +108,7 @@ group :development do
|
|||||||
gem "pronto-rubocop", "~> 0.11.1", require: false
|
gem "pronto-rubocop", "~> 0.11.1", require: false
|
||||||
gem "pronto-scss", "~> 0.11.0", require: false
|
gem "pronto-scss", "~> 0.11.0", require: false
|
||||||
gem "rubocop", "~> 0.93.1", 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-rails", "~> 2.9.1", require: false
|
||||||
gem "rubocop-rspec", "~> 1.44.1", require: false
|
gem "rubocop-rspec", "~> 1.44.1", require: false
|
||||||
gem "rvm1-capistrano3", "~> 1.4.0", require: false
|
gem "rvm1-capistrano3", "~> 1.4.0", require: false
|
||||||
|
|||||||
@@ -553,8 +553,9 @@ GEM
|
|||||||
unicode-display_width (>= 1.4.0, < 2.0)
|
unicode-display_width (>= 1.4.0, < 2.0)
|
||||||
rubocop-ast (1.9.0)
|
rubocop-ast (1.9.0)
|
||||||
parser (>= 3.0.1.1)
|
parser (>= 3.0.1.1)
|
||||||
rubocop-performance (1.7.1)
|
rubocop-performance (1.10.2)
|
||||||
rubocop (>= 0.82.0)
|
rubocop (>= 0.90.0, < 2.0)
|
||||||
|
rubocop-ast (>= 0.4.0)
|
||||||
rubocop-rails (2.9.1)
|
rubocop-rails (2.9.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
@@ -771,7 +772,7 @@ DEPENDENCIES
|
|||||||
rollbar (~> 3.1.2)
|
rollbar (~> 3.1.2)
|
||||||
rspec-rails (~> 4.0)
|
rspec-rails (~> 4.0)
|
||||||
rubocop (~> 0.93.1)
|
rubocop (~> 0.93.1)
|
||||||
rubocop-performance (~> 1.7.1)
|
rubocop-performance (~> 1.10.1)
|
||||||
rubocop-rails (~> 2.9.1)
|
rubocop-rails (~> 2.9.1)
|
||||||
rubocop-rspec (~> 1.44.1)
|
rubocop-rspec (~> 1.44.1)
|
||||||
rvm1-capistrano3 (~> 1.4.0)
|
rvm1-capistrano3 (~> 1.4.0)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module Header
|
|||||||
end
|
end
|
||||||
|
|
||||||
tag.header do
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Budget::Stats
|
|||||||
end
|
end
|
||||||
|
|
||||||
def total_votes
|
def total_votes
|
||||||
budget.ballots.pluck(:ballot_lines_count).reduce(0) { |sum, x| sum + x }
|
budget.ballots.pluck(:ballot_lines_count).sum
|
||||||
end
|
end
|
||||||
|
|
||||||
def total_selected_investments
|
def total_selected_investments
|
||||||
@@ -72,18 +72,18 @@ class Budget::Stats
|
|||||||
end
|
end
|
||||||
|
|
||||||
groups[:total] = Hash.new(0)
|
groups[:total] = Hash.new(0)
|
||||||
groups[:total][:total_investments_count] = groups.map { |_k, v| v[:total_investments_count] }.sum
|
groups[:total][:total_investments_count] = groups.sum { |_k, v| v[:total_investments_count] }
|
||||||
groups[:total][:total_participants_support_phase] = groups.map { |_k, v| v[:total_participants_support_phase] }.sum
|
groups[:total][:total_participants_support_phase] = groups.sum { |_k, v| v[:total_participants_support_phase] }
|
||||||
groups[:total][:total_participants_vote_phase] = groups.map { |_k, v| v[:total_participants_vote_phase] }.sum
|
groups[:total][:total_participants_vote_phase] = groups.sum { |_k, v| v[:total_participants_vote_phase] }
|
||||||
groups[:total][:total_participants_every_phase] = groups.map { |_k, v| v[:total_participants_every_phase] }.sum
|
groups[:total][:total_participants_every_phase] = groups.sum { |_k, v| v[:total_participants_every_phase] }
|
||||||
|
|
||||||
budget.headings.each do |heading|
|
budget.headings.each do |heading|
|
||||||
groups[heading.id].merge!(calculate_heading_stats_with_totals(groups[heading.id], groups[:total], heading.population))
|
groups[heading.id].merge!(calculate_heading_stats_with_totals(groups[heading.id], groups[:total], heading.population))
|
||||||
end
|
end
|
||||||
|
|
||||||
groups[:total][:percentage_participants_support_phase] = groups.map { |_k, v| v[:percentage_participants_support_phase] }.sum
|
groups[:total][:percentage_participants_support_phase] = groups.sum { |_k, v| v[:percentage_participants_support_phase] }
|
||||||
groups[:total][:percentage_participants_vote_phase] = groups.map { |_k, v| v[:percentage_participants_vote_phase] }.sum
|
groups[:total][:percentage_participants_vote_phase] = groups.sum { |_k, v| v[:percentage_participants_vote_phase] }
|
||||||
groups[:total][:percentage_participants_every_phase] = groups.map { |_k, v| v[:percentage_participants_every_phase] }.sum
|
groups[:total][:percentage_participants_every_phase] = groups.sum { |_k, v| v[:percentage_participants_every_phase] }
|
||||||
|
|
||||||
groups
|
groups
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class Legislation::Process < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def total_comments
|
def total_comments
|
||||||
questions.sum(:comments_count) + draft_versions.map(&:total_comments).sum
|
questions.sum(:comments_count) + draft_versions.sum(&:total_comments)
|
||||||
end
|
end
|
||||||
|
|
||||||
def status
|
def status
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ module RemoteTranslations::Microsoft::SentencesParser
|
|||||||
end
|
end
|
||||||
|
|
||||||
def characters_count(texts)
|
def characters_count(texts)
|
||||||
texts.map(&:size).reduce(:+)
|
texts.sum(&:size)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ namespace :proposal_actions do
|
|||||||
5
|
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
|
goal_votes = Setting["votes_for_proposal_success"].to_f
|
||||||
cached_votes_up = 0
|
cached_votes_up = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user