Commit a9029660a156cb295894579f4dfd14a0c22150e8
1 parent
a5cb09a3
Exists in
master
and in
1 other branch
Rubocop: hash indentation now a consistent one level
Showing
8 changed files
with
74 additions
and
77 deletions
Show diff stats
.rubocop.yml
.rubocop_todo.yml
| ... | ... | @@ -195,12 +195,6 @@ Style/IndentArray: |
| 195 | 195 | - 'app/models/notification_services/slack_service.rb' |
| 196 | 196 | - 'spec/models/notification_service/slack_service_spec.rb' |
| 197 | 197 | |
| 198 | -# Offense count: 72 | |
| 199 | -# Cop supports --auto-correct. | |
| 200 | -# Configuration parameters: EnforcedStyle, SupportedStyles. | |
| 201 | -Style/IndentHash: | |
| 202 | - Enabled: false | |
| 203 | - | |
| 204 | 198 | # Offense count: 27 |
| 205 | 199 | # Cop supports --auto-correct. |
| 206 | 200 | # Configuration parameters: EnforcedStyle, SupportedStyles. | ... | ... |
app/models/notification_services/gtalk_service.rb
| ... | ... | @@ -2,28 +2,28 @@ class NotificationServices::GtalkService < NotificationService |
| 2 | 2 | Label = "gtalk" |
| 3 | 3 | Fields += [ |
| 4 | 4 | [:subdomain, { |
| 5 | - :placeholder => "username@example.com", | |
| 6 | - :label => "Username" | |
| 5 | + :placeholder => "username@example.com", | |
| 6 | + :label => "Username" | |
| 7 | 7 | }], |
| 8 | 8 | [:api_token, { |
| 9 | - :placeholder => "password", | |
| 10 | - :label => "Password" | |
| 9 | + :placeholder => "password", | |
| 10 | + :label => "Password" | |
| 11 | 11 | }], |
| 12 | 12 | [:user_id, { |
| 13 | - :placeholder => "touser@example.com, anotheruser@example.com", | |
| 14 | - :label => "Send To User(s)" | |
| 15 | - }, :room_id], | |
| 13 | + :placeholder => "touser@example.com, anotheruser@example.com", | |
| 14 | + :label => "Send To User(s)" | |
| 15 | + }, :room_id], | |
| 16 | 16 | [:room_id, { |
| 17 | - :placeholder => "toroom@conference.example.com", | |
| 18 | - :label => "Send To Room (one only)" | |
| 17 | + :placeholder => "toroom@conference.example.com", | |
| 18 | + :label => "Send To Room (one only)" | |
| 19 | 19 | }, :user_id], |
| 20 | 20 | [ :service, { |
| 21 | - :placeholder => "talk.google.com", | |
| 22 | - :label => "Jabber Service" | |
| 21 | + :placeholder => "talk.google.com", | |
| 22 | + :label => "Jabber Service" | |
| 23 | 23 | }], |
| 24 | 24 | [ :service_url, { |
| 25 | - :placeholder => "http://www.google.com/talk/", | |
| 26 | - :label => "Link To Jabber Service" | |
| 25 | + :placeholder => "http://www.google.com/talk/", | |
| 26 | + :label => "Link To Jabber Service" | |
| 27 | 27 | }] |
| 28 | 28 | ] |
| 29 | 29 | ... | ... |
app/models/notification_services/hoiio_service.rb
| ... | ... | @@ -2,16 +2,16 @@ class NotificationServices::HoiioService < NotificationService |
| 2 | 2 | Label = "hoiio" |
| 3 | 3 | Fields += [ |
| 4 | 4 | [:api_token, { |
| 5 | - :placeholder => "App ID", | |
| 6 | - :label => "App ID" | |
| 5 | + :placeholder => "App ID", | |
| 6 | + :label => "App ID" | |
| 7 | 7 | }], |
| 8 | 8 | [:subdomain, { |
| 9 | - :placeholder => "Access Token", | |
| 10 | - :label => "Access Token" | |
| 9 | + :placeholder => "Access Token", | |
| 10 | + :label => "Access Token" | |
| 11 | 11 | }], |
| 12 | 12 | [:room_id, { |
| 13 | - :placeholder => "+6511111111, +6511111111", | |
| 14 | - :label => "Recipient's phone numbers seperated by comma. Phone numbers should start with a \"+\" and country code." | |
| 13 | + :placeholder => "+6511111111, +6511111111", | |
| 14 | + :label => "Recipient's phone numbers seperated by comma. Phone numbers should start with a \"+\" and country code." | |
| 15 | 15 | }] |
| 16 | 16 | ] |
| 17 | 17 | ... | ... |
app/models/notification_services/pushover_service.rb
| ... | ... | @@ -2,12 +2,12 @@ class NotificationServices::PushoverService < NotificationService |
| 2 | 2 | Label = "pushover" |
| 3 | 3 | Fields += [ |
| 4 | 4 | [:api_token, { |
| 5 | - :placeholder => "User Key", | |
| 6 | - :label => "User Key" | |
| 5 | + :placeholder => "User Key", | |
| 6 | + :label => "User Key" | |
| 7 | 7 | }], |
| 8 | 8 | [:subdomain, { |
| 9 | - :placeholder => "Application API Token", | |
| 10 | - :label => "Application API Token" | |
| 9 | + :placeholder => "Application API Token", | |
| 10 | + :label => "Application API Token" | |
| 11 | 11 | }] |
| 12 | 12 | ] |
| 13 | 13 | ... | ... |
app/models/notification_services/slack_service.rb
| ... | ... | @@ -21,39 +21,39 @@ class NotificationServices::SlackService < NotificationService |
| 21 | 21 | { |
| 22 | 22 | :attachments => [ |
| 23 | 23 | { |
| 24 | - :fallback => message_for_slack(problem), | |
| 25 | - :pretext => "<#{problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", | |
| 26 | - :color => "#D00000", | |
| 27 | - :fields => [ | |
| 24 | + :fallback => message_for_slack(problem), | |
| 25 | + :pretext => "<#{problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", | |
| 26 | + :color => "#D00000", | |
| 27 | + :fields => [ | |
| 28 | 28 | { |
| 29 | - :title => "Environment", | |
| 30 | - :value => problem.environment, | |
| 31 | - :short => false | |
| 29 | + :title => "Environment", | |
| 30 | + :value => problem.environment, | |
| 31 | + :short => false | |
| 32 | 32 | }, |
| 33 | 33 | { |
| 34 | - :title => "Location", | |
| 35 | - :value => problem.where, | |
| 36 | - :short => false | |
| 34 | + :title => "Location", | |
| 35 | + :value => problem.where, | |
| 36 | + :short => false | |
| 37 | 37 | }, |
| 38 | 38 | { |
| 39 | - :title => "Message", | |
| 40 | - :value => problem.message.to_s, | |
| 41 | - :short => false | |
| 39 | + :title => "Message", | |
| 40 | + :value => problem.message.to_s, | |
| 41 | + :short => false | |
| 42 | 42 | }, |
| 43 | 43 | { |
| 44 | - :title => "First Noticed", | |
| 45 | - :value => problem.first_notice_at, | |
| 46 | - :short => false | |
| 44 | + :title => "First Noticed", | |
| 45 | + :value => problem.first_notice_at, | |
| 46 | + :short => false | |
| 47 | 47 | }, |
| 48 | 48 | { |
| 49 | - :title => "Last Noticed", | |
| 50 | - :value => problem.last_notice_at, | |
| 51 | - :short => false | |
| 49 | + :title => "Last Noticed", | |
| 50 | + :value => problem.last_notice_at, | |
| 51 | + :short => false | |
| 52 | 52 | }, |
| 53 | 53 | { |
| 54 | - :title => "Times Occurred", | |
| 55 | - :value => problem.notices_count, | |
| 56 | - :short => false | |
| 54 | + :title => "Times Occurred", | |
| 55 | + :value => problem.notices_count, | |
| 56 | + :short => false | |
| 57 | 57 | } |
| 58 | 58 | ] |
| 59 | 59 | } | ... | ... |
spec/models/app_spec.rb
| ... | ... | @@ -165,10 +165,10 @@ describe App, type: 'model' do |
| 165 | 165 | context '#find_or_create_err!' do |
| 166 | 166 | let(:app) { Fabricate(:app) } |
| 167 | 167 | let(:conditions) { { |
| 168 | - :error_class => 'Whoops', | |
| 169 | - :environment => 'production', | |
| 170 | - :fingerprint => 'some-finger-print' | |
| 171 | - } | |
| 168 | + :error_class => 'Whoops', | |
| 169 | + :environment => 'production', | |
| 170 | + :fingerprint => 'some-finger-print' | |
| 171 | + } | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | it 'returns the correct err if one already exists' do | ... | ... |
spec/models/notification_service/slack_service_spec.rb
| ... | ... | @@ -9,39 +9,39 @@ describe NotificationServices::SlackService, type: 'model' do |
| 9 | 9 | payload = { |
| 10 | 10 | :attachments => [ |
| 11 | 11 | { |
| 12 | - :fallback => notification_service.message_for_slack(problem), | |
| 13 | - :pretext => "<#{notification_service.problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", | |
| 14 | - :color => "#D00000", | |
| 15 | - :fields => [ | |
| 12 | + :fallback => notification_service.message_for_slack(problem), | |
| 13 | + :pretext => "<#{notification_service.problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>", | |
| 14 | + :color => "#D00000", | |
| 15 | + :fields => [ | |
| 16 | 16 | { |
| 17 | - :title => "Environment", | |
| 18 | - :value => problem.environment, | |
| 19 | - :short => false | |
| 17 | + :title => "Environment", | |
| 18 | + :value => problem.environment, | |
| 19 | + :short => false | |
| 20 | 20 | }, |
| 21 | 21 | { |
| 22 | - :title => "Location", | |
| 23 | - :value => problem.where, | |
| 24 | - :short => false | |
| 22 | + :title => "Location", | |
| 23 | + :value => problem.where, | |
| 24 | + :short => false | |
| 25 | 25 | }, |
| 26 | 26 | { |
| 27 | - :title => "Message", | |
| 28 | - :value => problem.message.to_s, | |
| 29 | - :short => false | |
| 27 | + :title => "Message", | |
| 28 | + :value => problem.message.to_s, | |
| 29 | + :short => false | |
| 30 | 30 | }, |
| 31 | 31 | { |
| 32 | - :title => "First Noticed", | |
| 33 | - :value => problem.first_notice_at, | |
| 34 | - :short => false | |
| 32 | + :title => "First Noticed", | |
| 33 | + :value => problem.first_notice_at, | |
| 34 | + :short => false | |
| 35 | 35 | }, |
| 36 | 36 | { |
| 37 | - :title => "Last Noticed", | |
| 38 | - :value => problem.last_notice_at, | |
| 39 | - :short => false | |
| 37 | + :title => "Last Noticed", | |
| 38 | + :value => problem.last_notice_at, | |
| 39 | + :short => false | |
| 40 | 40 | }, |
| 41 | 41 | { |
| 42 | - :title => "Times Occurred", | |
| 43 | - :value => problem.notices_count, | |
| 44 | - :short => false | |
| 42 | + :title => "Times Occurred", | |
| 43 | + :value => problem.notices_count, | |
| 44 | + :short => false | |
| 45 | 45 | } |
| 46 | 46 | ] |
| 47 | 47 | } | ... | ... |