From 033f3c33e398b34ec0166223fe190ab66c04831e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 24 Oct 2019 16:25:20 +0200 Subject: [PATCH] Add SpaceAroundEqualsInParameterDefault rule We were using it in most places, but not everywhere. --- .rubocop_basic.yml | 3 +++ app/helpers/map_locations_helper.rb | 4 ++-- app/models/votation_type.rb | 2 +- config/initializers/vote_extensions.rb | 2 +- spec/support/common_actions.rb | 2 +- spec/support/common_actions/users.rb | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index f4113b870..ab236de9d 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -52,6 +52,9 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + Layout/IndentationConsistency: EnforcedStyle: indented_internal_methods diff --git a/app/helpers/map_locations_helper.rb b/app/helpers/map_locations_helper.rb index 62f552da1..0efc8097a 100644 --- a/app/helpers/map_locations_helper.rb +++ b/app/helpers/map_locations_helper.rb @@ -23,7 +23,7 @@ module MapLocationsHelper "remove-marker-link-#{dom_id(map_location)}" end - def render_map(map_location, parent_class, editable, remove_marker_label, investments_coordinates=nil) + def render_map(map_location, parent_class, editable, remove_marker_label, investments_coordinates = nil) map_location = MapLocation.new if map_location.nil? map = content_tag :div, "", id: dom_id(map_location), @@ -46,7 +46,7 @@ module MapLocationsHelper private - def prepare_map_settings(map_location, editable, parent_class, investments_coordinates=nil) + def prepare_map_settings(map_location, editable, parent_class, investments_coordinates = nil) options = { map: "", map_center_latitude: map_location_latitude(map_location), diff --git a/app/models/votation_type.rb b/app/models/votation_type.rb index 15e60ba0d..661a2a2bf 100644 --- a/app/models/votation_type.rb +++ b/app/models/votation_type.rb @@ -105,7 +105,7 @@ class VotationType < ApplicationRecord result end - def create_question_answer(answer, hidden=false) + def create_question_answer(answer, hidden = false) return if questionable.question_answers.where(title: answer).any? questionable.question_answers diff --git a/config/initializers/vote_extensions.rb b/config/initializers/vote_extensions.rb index 2390eed14..fb65d84a1 100644 --- a/config/initializers/vote_extensions.rb +++ b/config/initializers/vote_extensions.rb @@ -25,7 +25,7 @@ ActsAsVotable::Vote.class_eval do where(votable_type: "Legislation::Proposal", votable_id: proposals) end - def self.for_budget_investments(budget_investments=Budget::Investment.all) + def self.for_budget_investments(budget_investments = Budget::Investment.all) where(votable_type: "Budget::Investment", votable_id: budget_investments) end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 7d23bb2e4..42d5432b7 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -36,7 +36,7 @@ module CommonActions check "proposal_terms_of_service" end - def set_officing_booth(booth=nil) + def set_officing_booth(booth = nil) booth = create(:poll_booth) if booth.blank? allow_any_instance_of(Officing::BaseController). diff --git a/spec/support/common_actions/users.rb b/spec/support/common_actions/users.rb index 27b2986f1..d5fde76d4 100644 --- a/spec/support/common_actions/users.rb +++ b/spec/support/common_actions/users.rb @@ -13,7 +13,7 @@ module Users click_button "Register" end - def login_through_form_with_email_and_password(email="manuela@consul.dev", password="judgementday") + def login_through_form_with_email_and_password(email = "manuela@consul.dev", password = "judgementday") visit root_path click_link "Sign in"