Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-26 18:03:40 +02:00
parent e6dd33bd66
commit d7b8777395
15 changed files with 19 additions and 41 deletions

View File

@@ -557,28 +557,6 @@ Style/RescueModifier:
- 'app/controllers/concerns/commentable_actions.rb' - 'app/controllers/concerns/commentable_actions.rb'
- 'app/controllers/verification/sms_controller.rb' - 'app/controllers/verification/sms_controller.rb'
# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'app/helpers/cache_keys_helper.rb'
- 'app/helpers/proposals_helper.rb'
- 'app/helpers/spending_proposals_helper.rb'
- 'app/helpers/stats_helper.rb'
- 'app/helpers/tracks_helper.rb'
- 'app/helpers/valuation_helper.rb'
- 'app/mailers/devise_mailer.rb'
- 'app/models/comment.rb'
- 'app/models/tag_cloud.rb'
- 'app/models/verification/residence.rb'
- 'lib/acts_as_paranoid_aliases.rb'
- 'lib/capistrano/template.rb'
- 'lib/census_api.rb'
- 'lib/manager_authenticator.rb'
- 'spec/support/common_actions.rb'
# Offense count: 66 # Offense count: 66
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment. # Configuration parameters: AllowForAlignment.

View File

@@ -1,11 +1,11 @@
module CacheKeysHelper module CacheKeysHelper
def locale_and_user_status(authorable=nil) def locale_and_user_status(authorable = nil)
@cache_key_user ||= calculate_user_status(authorable) @cache_key_user ||= calculate_user_status(authorable)
"#{I18n.locale}/#{@cache_key_user}" "#{I18n.locale}/#{@cache_key_user}"
end end
def calculate_user_status(authorable=nil) def calculate_user_status(authorable = nil)
user_status = "user" user_status = "user"
if user_signed_in? if user_signed_in?

View File

@@ -18,7 +18,7 @@ module ProposalsHelper
end end
end end
def namespaced_proposal_path(proposal, options={}) def namespaced_proposal_path(proposal, options = {})
@namespace_proposal_path ||= namespace @namespace_proposal_path ||= namespace
case @namespace_proposal_path case @namespace_proposal_path
when "management" when "management"

View File

@@ -4,7 +4,7 @@ module SpendingProposalsHelper
ActsAsTaggableOn::Tag.spending_proposal_tags.pluck(:name) ActsAsTaggableOn::Tag.spending_proposal_tags.pluck(:name)
end end
def namespaced_spending_proposal_path(spending_proposal, options={}) def namespaced_spending_proposal_path(spending_proposal, options = {})
@namespace_spending_proposal_path ||= namespace @namespace_spending_proposal_path ||= namespace
case @namespace_spending_proposal_path case @namespace_spending_proposal_path
when "management" when "management"

View File

@@ -1,27 +1,27 @@
module StatsHelper module StatsHelper
def events_chart_tag(events, opt={}) def events_chart_tag(events, opt = {})
events = events.join(',') if events.is_a? Array events = events.join(',') if events.is_a? Array
opt[:data] ||= {} opt[:data] ||= {}
opt[:data][:graph] = admin_api_stats_path(events: events) opt[:data][:graph] = admin_api_stats_path(events: events)
content_tag :div, "", opt content_tag :div, "", opt
end end
def visits_chart_tag(opt={}) def visits_chart_tag(opt = {})
events = events.join(',') if events.is_a? Array events = events.join(',') if events.is_a? Array
opt[:data] ||= {} opt[:data] ||= {}
opt[:data][:graph] = admin_api_stats_path(visits: true) opt[:data][:graph] = admin_api_stats_path(visits: true)
content_tag :div, "", opt content_tag :div, "", opt
end end
def spending_proposals_chart_tag(opt={}) def spending_proposals_chart_tag(opt = {})
events = events.join(',') if events.is_a? Array events = events.join(',') if events.is_a? Array
opt[:data] ||= {} opt[:data] ||= {}
opt[:data][:graph] = admin_api_stats_path(spending_proposals: true) opt[:data][:graph] = admin_api_stats_path(spending_proposals: true)
content_tag :div, "", opt content_tag :div, "", opt
end end
def budget_investments_chart_tag(opt={}) def budget_investments_chart_tag(opt = {})
events = events.join(',') if events.is_a? Array events = events.join(',') if events.is_a? Array
opt[:data] ||= {} opt[:data] ||= {}
opt[:data][:graph] = admin_api_stats_path(budget_investments: true) opt[:data][:graph] = admin_api_stats_path(budget_investments: true)

View File

@@ -1,6 +1,6 @@
module TracksHelper module TracksHelper
def track_event(data={}) def track_event(data = {})
track_data = "" track_data = ""
prefix = " data-track-event-" prefix = " data-track-event-"
data.each do |key, value| data.each do |key, value|

View File

@@ -1,6 +1,6 @@
module ValuationHelper module ValuationHelper
def valuator_select_options(valuator=nil) def valuator_select_options(valuator = nil)
if valuator.present? if valuator.present?
Valuator.where.not(id: valuator.id).order("description ASC").order("users.email ASC").includes(:user).collect { |v| [ v.description_or_email, v.id ] }.prepend([valuator.description_or_email, valuator.id]) Valuator.where.not(id: valuator.id).order("description ASC").order("users.email ASC").includes(:user).collect { |v| [ v.description_or_email, v.id ] }.prepend([valuator.description_or_email, valuator.id])
else else

View File

@@ -5,7 +5,7 @@ class DeviseMailer < Devise::Mailer
protected protected
def devise_mail(record, action, opts={}) def devise_mail(record, action, opts = {})
I18n.with_locale record.locale do I18n.with_locale record.locale do
super(record, action, opts) super(record, action, opts)
end end

View File

@@ -44,7 +44,7 @@ class Comment < ActiveRecord::Base
after_create :call_after_commented after_create :call_after_commented
def self.build(commentable, user, body, p_id=nil) def self.build(commentable, user, body, p_id = nil)
new commentable: commentable, new commentable: commentable,
user_id: user.id, user_id: user.id,
body: body, body: body,

View File

@@ -13,7 +13,7 @@ class Officing::Residence
validate :allowed_age validate :allowed_age
validate :residence_in_madrid validate :residence_in_madrid
def initialize(attrs={}) def initialize(attrs = {})
super super
clean_document_number clean_document_number
end end

View File

@@ -2,7 +2,7 @@ class TagCloud
attr_accessor :resource_model, :scope attr_accessor :resource_model, :scope
def initialize(resource_model, scope=nil) def initialize(resource_model, scope = nil)
@resource_model = resource_model @resource_model = resource_model
@scope = scope @scope = scope
end end

View File

@@ -17,7 +17,7 @@ class Verification::Residence
validate :allowed_age validate :allowed_age
validate :document_number_uniqueness validate :document_number_uniqueness
def initialize(attrs={}) def initialize(attrs = {})
self.date_of_birth = parse_date('date_of_birth', attrs) self.date_of_birth = parse_date('date_of_birth', attrs)
attrs = remove_date('date_of_birth', attrs) attrs = remove_date('date_of_birth', attrs)
super super

View File

@@ -25,7 +25,7 @@ module ActsAsParanoidAliases
update_attribute(:confirmed_hide_at, Time.current) update_attribute(:confirmed_hide_at, Time.current)
end end
def restore(opts={}) def restore(opts = {})
return false unless hidden? return false unless hidden?
super(opts) super(opts)
update_attribute(:confirmed_hide_at, nil) update_attribute(:confirmed_hide_at, nil)

View File

@@ -1,6 +1,6 @@
class ManagerAuthenticator class ManagerAuthenticator
def initialize(data={}) def initialize(data = {})
@manager = {login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion]}.with_indifferent_access @manager = {login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion]}.with_indifferent_access
end end

View File

@@ -1,6 +1,6 @@
module CommonActions module CommonActions
def sign_up(email='manuela@consul.dev', password='judgementday') def sign_up(email = 'manuela@consul.dev', password = 'judgementday')
visit '/' visit '/'
click_link 'Register' click_link 'Register'
@@ -109,7 +109,7 @@ module CommonActions
SCRIPT SCRIPT
end end
def error_message(resource_model=nil) def error_message(resource_model = nil)
resource_model ||= "(.*)" resource_model ||= "(.*)"
/\d errors? prevented this #{resource_model} from being saved:/ /\d errors? prevented this #{resource_model} from being saved:/
end end