From f8784fdcd8e2f2a55eb852df531362d9d9028046 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Wed, 30 Jul 2014 23:32:29 +0200 Subject: [PATCH] rubocop style fix Style/AlignParameters --- .rubocop.yml | 4 ++++ .rubocop_todo.yml | 11 +---------- app/controllers/admin/stats_controller.rb | 2 +- app/models/event.rb | 2 +- spec/controllers/admin/conferences_controller_spec.rb | 5 ++--- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 216f1c0a..1205d53b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -84,6 +84,10 @@ Lint/Void: Style/AlignHash: Enabled: true +# Align the parameters of a method call if they span more than one line +Style/AlignParameters: + Enabled: true + AllCops: Include: - '**/Rakefile' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 318072cf..1685d43c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -5,17 +5,8 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. -Style/AlignHash: - Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/AlignParameters: - Enabled: false + # Offense count: 2 # Cop supports --auto-correct. diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index b5685bff..c98b9892 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -128,7 +128,7 @@ module Admin day_ticket_count = @tickets.where('supporter_registrations.created_at LIKE ? AND supporter_levels.title LIKE ?', - "%#{day}%", "%#{level.title}%").count + "%#{day}%", "%#{level.title}%").count index = @tickets_time.index { |v| v['key'] == "#{level.title}" } @tickets_time[index]['values'] << { 'label' => "#{day}", 'value' => day_ticket_count } diff --git a/app/models/event.rb b/app/models/event.rb index 70306615..08d5d1b4 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -195,7 +195,7 @@ class Event < ActiveRecord::Base begin if mail self.send(transition, - send_mail: send_mail_param) + send_mail: send_mail_param) else self.send(transition) end diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index 7865e2f2..e3286fa0 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -19,8 +19,7 @@ describe Admin::ConferenceController do context 'valid attributes' do it 'locates the requested conference' do - patch :update, id: conference.short_title, conference: - attributes_for(:conference, title: 'Example Con') + patch :update, id: conference.short_title, conference: attributes_for(:conference, title: 'Example Con') expect(assigns(:conference)).to eq(conference) end @@ -267,7 +266,7 @@ describe Admin::ConferenceController do it 'requires admin privileges' do patch :update, id: conference.short_title, conference: attributes_for(:conference, - short_title: 'ExCon') + short_title: 'ExCon') expect(response).to redirect_to(send(success_path)) end end