From 29650beddbd9ccb1c5386466bd68a40e19c687ef Mon Sep 17 00:00:00 2001 From: Iris Sprague Date: Tue, 28 Mar 2017 22:20:27 -0400 Subject: [PATCH] enable negatedif and correct db file fix spacing --- .rubocop.yml | 12 ++++++++---- .rubocop_todo.yml | 14 -------------- ...ting_supporter_registrations_to_ticket_users.rb | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index bf158032..e9475b21 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -63,15 +63,15 @@ Style/EmptyLiteral: Style/For: Enabled: true -# Checks that operators have space around them, except for ** which should not have surrounding space. -Style/SpaceAroundOperators: - Enabled: true - # Use the new Ruby 1.9 hash syntax Style/HashSyntax: Enabled: true EnforcedStyle: ruby19 +# Checks for uses of if with negated condition. Use unless instead +Style/NegatedIf: + Enabled: true + # Do not compare with nil. Use .nil? instead Style/NilComparison: Enabled: true @@ -80,6 +80,10 @@ Style/NilComparison: Style/RedundantSelf: Enabled: true +# Checks that operators have space around them, except for ** which should not have surrounding space. +Style/SpaceAroundOperators: + Enabled: true + # Use single quotes unless there's string interpolation Style/StringLiterals: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a0487443..d6a99f84 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -439,20 +439,6 @@ Style/MutableConstant: - 'app/models/event_user.rb' - 'app/models/role.rb' -# Offense count: 16 -# Cop supports --auto-correct. -Style/NegatedIf: - Exclude: - - 'app/controllers/admin/events_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/conference_registrations_controller.rb' - - 'app/controllers/proposal_controller.rb' - - 'app/models/conference.rb' - - 'app/models/datatable.rb' - - 'app/models/event.rb' - - 'app/models/venue.rb' - - 'db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb' - # Offense count: 4 Style/NestedParenthesizedCalls: Exclude: diff --git a/db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb b/db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb index 5affe0cf..8be20de2 100644 --- a/db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb +++ b/db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb @@ -30,7 +30,7 @@ class MigratingSupporterRegistrationsToTicketUsers < ActiveRecord::Migration s.save end end - if !s.user_id + unless s.user_id s.user_id = deleted_user.id s.save end