diff --git a/.rubocop.yml b/.rubocop.yml index d44d044..6cda0d2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -28,3 +28,6 @@ Style/AccessModifierIndentation: Style/AlignParameters: EnforcedStyle: with_fixed_indentation + +Style/IndentHash: + EnforcedStyle: consistent diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 345ea21..7faf3c1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -195,12 +195,6 @@ Style/IndentArray: - 'app/models/notification_services/slack_service.rb' - 'spec/models/notification_service/slack_service_spec.rb' -# Offense count: 72 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/IndentHash: - Enabled: false - # Offense count: 27 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/models/notification_services/gtalk_service.rb b/app/models/notification_services/gtalk_service.rb index 37b72ed..d63d9a0 100644 --- a/app/models/notification_services/gtalk_service.rb +++ b/app/models/notification_services/gtalk_service.rb @@ -2,28 +2,28 @@ class NotificationServices::GtalkService < NotificationService Label = "gtalk" Fields += [ [:subdomain, { - :placeholder => "username@example.com", - :label => "Username" + :placeholder => "username@example.com", + :label => "Username" }], [:api_token, { - :placeholder => "password", - :label => "Password" + :placeholder => "password", + :label => "Password" }], [:user_id, { - :placeholder => "touser@example.com, anotheruser@example.com", - :label => "Send To User(s)" - }, :room_id], + :placeholder => "touser@example.com, anotheruser@example.com", + :label => "Send To User(s)" + }, :room_id], [:room_id, { - :placeholder => "toroom@conference.example.com", - :label => "Send To Room (one only)" + :placeholder => "toroom@conference.example.com", + :label => "Send To Room (one only)" }, :user_id], [ :service, { - :placeholder => "talk.google.com", - :label => "Jabber Service" + :placeholder => "talk.google.com", + :label => "Jabber Service" }], [ :service_url, { - :placeholder => "http://www.google.com/talk/", - :label => "Link To Jabber Service" + :placeholder => "http://www.google.com/talk/", + :label => "Link To Jabber Service" }] ] diff --git a/app/models/notification_services/hoiio_service.rb b/app/models/notification_services/hoiio_service.rb index f0625ef..d733d1a 100644 --- a/app/models/notification_services/hoiio_service.rb +++ b/app/models/notification_services/hoiio_service.rb @@ -2,16 +2,16 @@ class NotificationServices::HoiioService < NotificationService Label = "hoiio" Fields += [ [:api_token, { - :placeholder => "App ID", - :label => "App ID" + :placeholder => "App ID", + :label => "App ID" }], [:subdomain, { - :placeholder => "Access Token", - :label => "Access Token" + :placeholder => "Access Token", + :label => "Access Token" }], [:room_id, { - :placeholder => "+6511111111, +6511111111", - :label => "Recipient's phone numbers seperated by comma. Phone numbers should start with a \"+\" and country code." + :placeholder => "+6511111111, +6511111111", + :label => "Recipient's phone numbers seperated by comma. Phone numbers should start with a \"+\" and country code." }] ] diff --git a/app/models/notification_services/pushover_service.rb b/app/models/notification_services/pushover_service.rb index 76bffcd..cdec60d 100644 --- a/app/models/notification_services/pushover_service.rb +++ b/app/models/notification_services/pushover_service.rb @@ -2,12 +2,12 @@ class NotificationServices::PushoverService < NotificationService Label = "pushover" Fields += [ [:api_token, { - :placeholder => "User Key", - :label => "User Key" + :placeholder => "User Key", + :label => "User Key" }], [:subdomain, { - :placeholder => "Application API Token", - :label => "Application API Token" + :placeholder => "Application API Token", + :label => "Application API Token" }] ] diff --git a/app/models/notification_services/slack_service.rb b/app/models/notification_services/slack_service.rb index ab689e8..46a7d29 100644 --- a/app/models/notification_services/slack_service.rb +++ b/app/models/notification_services/slack_service.rb @@ -21,39 +21,39 @@ class NotificationServices::SlackService < NotificationService { :attachments => [ { - :fallback => message_for_slack(problem), - :pretext => "<#{problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", - :color => "#D00000", - :fields => [ + :fallback => message_for_slack(problem), + :pretext => "<#{problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", + :color => "#D00000", + :fields => [ { - :title => "Environment", - :value => problem.environment, - :short => false + :title => "Environment", + :value => problem.environment, + :short => false }, { - :title => "Location", - :value => problem.where, - :short => false + :title => "Location", + :value => problem.where, + :short => false }, { - :title => "Message", - :value => problem.message.to_s, - :short => false + :title => "Message", + :value => problem.message.to_s, + :short => false }, { - :title => "First Noticed", - :value => problem.first_notice_at, - :short => false + :title => "First Noticed", + :value => problem.first_notice_at, + :short => false }, { - :title => "Last Noticed", - :value => problem.last_notice_at, - :short => false + :title => "Last Noticed", + :value => problem.last_notice_at, + :short => false }, { - :title => "Times Occurred", - :value => problem.notices_count, - :short => false + :title => "Times Occurred", + :value => problem.notices_count, + :short => false } ] } diff --git a/spec/models/app_spec.rb b/spec/models/app_spec.rb index bf61ad7..622bc4b 100644 --- a/spec/models/app_spec.rb +++ b/spec/models/app_spec.rb @@ -165,10 +165,10 @@ describe App, type: 'model' do context '#find_or_create_err!' do let(:app) { Fabricate(:app) } let(:conditions) { { - :error_class => 'Whoops', - :environment => 'production', - :fingerprint => 'some-finger-print' - } + :error_class => 'Whoops', + :environment => 'production', + :fingerprint => 'some-finger-print' + } } it 'returns the correct err if one already exists' do diff --git a/spec/models/notification_service/slack_service_spec.rb b/spec/models/notification_service/slack_service_spec.rb index 1692257..6be0c5f 100644 --- a/spec/models/notification_service/slack_service_spec.rb +++ b/spec/models/notification_service/slack_service_spec.rb @@ -9,39 +9,39 @@ describe NotificationServices::SlackService, type: 'model' do payload = { :attachments => [ { - :fallback => notification_service.message_for_slack(problem), - :pretext => "<#{notification_service.problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", - :color => "#D00000", - :fields => [ + :fallback => notification_service.message_for_slack(problem), + :pretext => "<#{notification_service.problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", + :color => "#D00000", + :fields => [ { - :title => "Environment", - :value => problem.environment, - :short => false + :title => "Environment", + :value => problem.environment, + :short => false }, { - :title => "Location", - :value => problem.where, - :short => false + :title => "Location", + :value => problem.where, + :short => false }, { - :title => "Message", - :value => problem.message.to_s, - :short => false + :title => "Message", + :value => problem.message.to_s, + :short => false }, { - :title => "First Noticed", - :value => problem.first_notice_at, - :short => false + :title => "First Noticed", + :value => problem.first_notice_at, + :short => false }, { - :title => "Last Noticed", - :value => problem.last_notice_at, - :short => false + :title => "Last Noticed", + :value => problem.last_notice_at, + :short => false }, { - :title => "Times Occurred", - :value => problem.notices_count, - :short => false + :title => "Times Occurred", + :value => problem.notices_count, + :short => false } ] } -- libgit2 0.21.2