Commit 448a1c087b7542539c2d91657c9169bf67fd404c

Authored by Laust Rud Jacobsen
1 parent a9029660
Exists in master and in 1 other branch production

Rubocop: consistent array value indentation

.rubocop_todo.yml
... ... @@ -185,16 +185,6 @@ Style/IfUnlessModifier:
185 185 - 'app/models/notice.rb'
186 186 - 'app/models/user.rb'
187 187  
188   -# Offense count: 5
189   -# Cop supports --auto-correct.
190   -Style/IndentArray:
191   - Exclude:
192   - - 'app/models/notification_services/gtalk_service.rb'
193   - - 'app/models/notification_services/hoiio_service.rb'
194   - - 'app/models/notification_services/pushover_service.rb'
195   - - 'app/models/notification_services/slack_service.rb'
196   - - 'spec/models/notification_service/slack_service_spec.rb'
197   -
198 188 # Offense count: 27
199 189 # Cop supports --auto-correct.
200 190 # Configuration parameters: EnforcedStyle, SupportedStyles.
... ...
app/models/notification_services/gtalk_service.rb
1 1 class NotificationServices::GtalkService < NotificationService
2 2 Label = "gtalk"
3 3 Fields += [
4   - [:subdomain, {
5   - :placeholder => "username@example.com",
6   - :label => "Username"
7   - }],
8   - [:api_token, {
9   - :placeholder => "password",
10   - :label => "Password"
11   - }],
12   - [:user_id, {
13   - :placeholder => "touser@example.com, anotheruser@example.com",
14   - :label => "Send To User(s)"
15   - }, :room_id],
16   - [:room_id, {
17   - :placeholder => "toroom@conference.example.com",
18   - :label => "Send To Room (one only)"
19   - }, :user_id],
20   - [ :service, {
21   - :placeholder => "talk.google.com",
22   - :label => "Jabber Service"
23   - }],
24   - [ :service_url, {
25   - :placeholder => "http://www.google.com/talk/",
26   - :label => "Link To Jabber Service"
27   - }]
  4 + [:subdomain, {
  5 + :placeholder => "username@example.com",
  6 + :label => "Username"
  7 + }],
  8 + [:api_token, {
  9 + :placeholder => "password",
  10 + :label => "Password"
  11 + }],
  12 + [:user_id, {
  13 + :placeholder => "touser@example.com, anotheruser@example.com",
  14 + :label => "Send To User(s)"
  15 + }, :room_id],
  16 + [:room_id, {
  17 + :placeholder => "toroom@conference.example.com",
  18 + :label => "Send To Room (one only)"
  19 + }, :user_id],
  20 + [ :service, {
  21 + :placeholder => "talk.google.com",
  22 + :label => "Jabber Service"
  23 + }],
  24 + [ :service_url, {
  25 + :placeholder => "http://www.google.com/talk/",
  26 + :label => "Link To Jabber Service"
  27 + }]
28 28 ]
29 29  
30 30 def check_params
... ...
app/models/notification_services/hoiio_service.rb
1 1 class NotificationServices::HoiioService < NotificationService
2 2 Label = "hoiio"
3 3 Fields += [
4   - [:api_token, {
5   - :placeholder => "App ID",
6   - :label => "App ID"
7   - }],
8   - [:subdomain, {
9   - :placeholder => "Access Token",
10   - :label => "Access Token"
11   - }],
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."
15   - }]
  4 + [:api_token, {
  5 + :placeholder => "App ID",
  6 + :label => "App ID"
  7 + }],
  8 + [:subdomain, {
  9 + :placeholder => "Access Token",
  10 + :label => "Access Token"
  11 + }],
  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."
  15 + }]
16 16 ]
17 17  
18 18 def check_params
... ...
app/models/notification_services/pushover_service.rb
1 1 class NotificationServices::PushoverService < NotificationService
2 2 Label = "pushover"
3 3 Fields += [
4   - [:api_token, {
5   - :placeholder => "User Key",
6   - :label => "User Key"
7   - }],
8   - [:subdomain, {
9   - :placeholder => "Application API Token",
10   - :label => "Application API Token"
11   - }]
  4 + [:api_token, {
  5 + :placeholder => "User Key",
  6 + :label => "User Key"
  7 + }],
  8 + [:subdomain, {
  9 + :placeholder => "Application API Token",
  10 + :label => "Application API Token"
  11 + }]
12 12 ]
13 13  
14 14 def check_params
... ...
app/models/notification_services/slack_service.rb
... ... @@ -25,37 +25,37 @@ class NotificationServices::SlackService &lt; NotificationService
25 25 :pretext => "<#{problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>",
26 26 :color => "#D00000",
27 27 :fields => [
28   - {
29   - :title => "Environment",
30   - :value => problem.environment,
31   - :short => false
32   - },
33   - {
34   - :title => "Location",
35   - :value => problem.where,
36   - :short => false
37   - },
38   - {
39   - :title => "Message",
40   - :value => problem.message.to_s,
41   - :short => false
42   - },
43   - {
44   - :title => "First Noticed",
45   - :value => problem.first_notice_at,
46   - :short => false
47   - },
48   - {
49   - :title => "Last Noticed",
50   - :value => problem.last_notice_at,
51   - :short => false
52   - },
53   - {
54   - :title => "Times Occurred",
55   - :value => problem.notices_count,
56   - :short => false
57   - }
58   - ]
  28 + {
  29 + :title => "Environment",
  30 + :value => problem.environment,
  31 + :short => false
  32 + },
  33 + {
  34 + :title => "Location",
  35 + :value => problem.where,
  36 + :short => false
  37 + },
  38 + {
  39 + :title => "Message",
  40 + :value => problem.message.to_s,
  41 + :short => false
  42 + },
  43 + {
  44 + :title => "First Noticed",
  45 + :value => problem.first_notice_at,
  46 + :short => false
  47 + },
  48 + {
  49 + :title => "Last Noticed",
  50 + :value => problem.last_notice_at,
  51 + :short => false
  52 + },
  53 + {
  54 + :title => "Times Occurred",
  55 + :value => problem.notices_count,
  56 + :short => false
  57 + }
  58 + ]
59 59 }
60 60 ]
61 61 }.to_json
... ...
spec/models/notification_service/slack_service_spec.rb
... ... @@ -13,37 +13,37 @@ describe NotificationServices::SlackService, type: &#39;model&#39; do
13 13 :pretext => "<#{notification_service.problem_url(problem)}|Errbit - #{problem.app.name}: #{problem.error_class}>",
14 14 :color => "#D00000",
15 15 :fields => [
16   - {
17   - :title => "Environment",
18   - :value => problem.environment,
19   - :short => false
20   - },
21   - {
22   - :title => "Location",
23   - :value => problem.where,
24   - :short => false
25   - },
26   - {
27   - :title => "Message",
28   - :value => problem.message.to_s,
29   - :short => false
30   - },
31   - {
32   - :title => "First Noticed",
33   - :value => problem.first_notice_at,
34   - :short => false
35   - },
36   - {
37   - :title => "Last Noticed",
38   - :value => problem.last_notice_at,
39   - :short => false
40   - },
41   - {
42   - :title => "Times Occurred",
43   - :value => problem.notices_count,
44   - :short => false
45   - }
46   - ]
  16 + {
  17 + :title => "Environment",
  18 + :value => problem.environment,
  19 + :short => false
  20 + },
  21 + {
  22 + :title => "Location",
  23 + :value => problem.where,
  24 + :short => false
  25 + },
  26 + {
  27 + :title => "Message",
  28 + :value => problem.message.to_s,
  29 + :short => false
  30 + },
  31 + {
  32 + :title => "First Noticed",
  33 + :value => problem.first_notice_at,
  34 + :short => false
  35 + },
  36 + {
  37 + :title => "Last Noticed",
  38 + :value => problem.last_notice_at,
  39 + :short => false
  40 + },
  41 + {
  42 + :title => "Times Occurred",
  43 + :value => problem.notices_count,
  44 + :short => false
  45 + }
  46 + ]
47 47 }
48 48 ]
49 49 }.to_json
... ...