From 535b3f86d6e88ca363e79ced231c4000be42f525 Mon Sep 17 00:00:00 2001 From: Cody Borders Date: Tue, 4 Apr 2017 11:48:52 -0600 Subject: [PATCH] Fixes Style/Tab cops Removes exclusions for Style/Tab cops in rubocop_todo Places Style/Tab cop in appropriate alphabetical order All cops now fixed. --- .rubocop.yml | 4 ++++ .rubocop_todo.yml | 11 ----------- ...545_add_require_handicapped_access_to_questions.rb | 10 +++++----- ...1225606_add_attending_with_partner_to_questions.rb | 10 +++++----- ...620_add_staying_at_suggested_hotel_to_questions.rb | 10 +++++----- ...225635_add_attending_social_events_to_questions.rb | 10 +++++----- ...162030_change_lodging_association_to_conference.rb | 2 +- spec/features/event_types_spec.rb | 2 +- 8 files changed, 26 insertions(+), 33 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c6b31025..4fc99f50 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -88,6 +88,10 @@ Style/SpaceAroundOperators: Style/StringLiterals: Enabled: true +# This cop checks for tabs where spaces should be used. +Style/Tab: + Enabled: true + # Avoid trailing blank lines Style/TrailingBlankLines: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index efef81bc..e0b537fb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -609,17 +609,6 @@ Style/SymbolProc: - 'spec/controllers/admin/conferences_controller_spec.rb' - 'spec/support/flash.rb' -# Offense count: 23 -# Cop supports --auto-correct. -Style/Tab: - Exclude: - - 'db/migrate/20141031225545_add_require_handicapped_access_to_questions.rb' - - 'db/migrate/20141031225606_add_attending_with_partner_to_questions.rb' - - 'db/migrate/20141031225620_add_staying_at_suggested_hotel_to_questions.rb' - - 'db/migrate/20141031225635_add_attending_social_events_to_questions.rb' - - 'db/migrate/20141118162030_change_lodging_association_to_conference.rb' - - 'spec/features/campaign_spec.rb' - - 'spec/features/event_types_spec.rb' # Offense count: 26 # Cop supports --auto-correct. diff --git a/db/migrate/20141031225545_add_require_handicapped_access_to_questions.rb b/db/migrate/20141031225545_add_require_handicapped_access_to_questions.rb index ed0d1f99..ad2328c9 100644 --- a/db/migrate/20141031225545_add_require_handicapped_access_to_questions.rb +++ b/db/migrate/20141031225545_add_require_handicapped_access_to_questions.rb @@ -75,11 +75,11 @@ class AddRequireHandicappedAccessToQuestions < ActiveRecord::Migration TempConferencesQuestions.find_or_create_by!(conference_id: c.id, question_id: q.id) TempRegistration.where(conference_id: c.id).each do |r| - if r.handicapped_access_required - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) - else - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) - end + if r.handicapped_access_required + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) + else + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) + end end end remove_column :registrations, :handicapped_access_required, :boolean diff --git a/db/migrate/20141031225606_add_attending_with_partner_to_questions.rb b/db/migrate/20141031225606_add_attending_with_partner_to_questions.rb index a7014539..0a63a380 100644 --- a/db/migrate/20141031225606_add_attending_with_partner_to_questions.rb +++ b/db/migrate/20141031225606_add_attending_with_partner_to_questions.rb @@ -75,11 +75,11 @@ class AddAttendingWithPartnerToQuestions < ActiveRecord::Migration TempConferencesQuestions.find_or_create_by!(conference_id: c.id, question_id: q.id) TempRegistration.where(conference_id: c.id).each do |r| - if r.attending_with_partner - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) - else - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) - end + if r.attending_with_partner + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) + else + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) + end end end remove_column :registrations, :attending_with_partner, :boolean diff --git a/db/migrate/20141031225620_add_staying_at_suggested_hotel_to_questions.rb b/db/migrate/20141031225620_add_staying_at_suggested_hotel_to_questions.rb index 71897787..fb0d8781 100644 --- a/db/migrate/20141031225620_add_staying_at_suggested_hotel_to_questions.rb +++ b/db/migrate/20141031225620_add_staying_at_suggested_hotel_to_questions.rb @@ -75,11 +75,11 @@ class AddStayingAtSuggestedHotelToQuestions < ActiveRecord::Migration TempConferencesQuestions.find_or_create_by!(conference_id: c.id, question_id: q.id) TempRegistration.where(conference_id: c.id).each do |r| - if r.using_affiliated_lodging - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) - else - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) - end + if r.using_affiliated_lodging + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) + else + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) + end end end remove_column :registrations, :using_affiliated_lodging, :boolean diff --git a/db/migrate/20141031225635_add_attending_social_events_to_questions.rb b/db/migrate/20141031225635_add_attending_social_events_to_questions.rb index ba950b10..54e3bb33 100644 --- a/db/migrate/20141031225635_add_attending_social_events_to_questions.rb +++ b/db/migrate/20141031225635_add_attending_social_events_to_questions.rb @@ -75,11 +75,11 @@ class AddAttendingSocialEventsToQuestions < ActiveRecord::Migration TempConferencesQuestions.find_or_create_by!(conference_id: c.id, question_id: q.id) TempRegistration.where(conference_id: c.id).each do |r| - if r.attending_social_events - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) - else - TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) - end + if r.attending_social_events + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_yes.id) + else + TempQanswerRegistration.find_or_create_by!(registration_id: r.id, qanswer_id: qa_no.id) + end end end remove_column :registrations, :attending_social_events, :boolean diff --git a/db/migrate/20141118162030_change_lodging_association_to_conference.rb b/db/migrate/20141118162030_change_lodging_association_to_conference.rb index e8699a07..352075ec 100644 --- a/db/migrate/20141118162030_change_lodging_association_to_conference.rb +++ b/db/migrate/20141118162030_change_lodging_association_to_conference.rb @@ -21,7 +21,7 @@ class ChangeLodgingAssociationToConference < ActiveRecord::Migration venue = TempVenue.find_by(conference_id: conference.id) lodgings = TempLodging.where(venue_id: venue.id) lodgings.each do |lodging| - lodging.update_attributes(conference_id: conference.id) + lodging.update_attributes(conference_id: conference.id) end end end diff --git a/spec/features/event_types_spec.rb b/spec/features/event_types_spec.rb index ea0fa735..6b3c9f0c 100644 --- a/spec/features/event_types_spec.rb +++ b/spec/features/event_types_spec.rb @@ -38,7 +38,7 @@ feature EventType do # Remove event type within('tr', text: 'Party') do - click_link 'Delete' + click_link 'Delete' end expect(flash).to eq('Event type successfully deleted.')