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/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
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
module ValuationHelper
def valuator_select_options(valuator=nil)
def valuator_select_options(valuator = nil)
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])
else

View File

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

View File

@@ -44,7 +44,7 @@ class Comment < ActiveRecord::Base
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,
user_id: user.id,
body: body,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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