Commit 4e09db484900e99351522de597c1f262c68175fe

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

Rubocop: consistently start a comment with a space

.rubocop_todo.yml
... ... @@ -104,19 +104,6 @@ Style/IfUnlessModifier:
104 104 - 'app/models/notice.rb'
105 105 - 'app/models/user.rb'
106 106  
107   -# Offense count: 17
108   -# Cop supports --auto-correct.
109   -Style/LeadingCommentSpace:
110   - Exclude:
111   - - 'app/models/notification_services/gtalk_service.rb'
112   - - 'spec/controllers/api/v1/notices_controller_spec.rb'
113   - - 'spec/controllers/api/v1/problems_controller_spec.rb'
114   - - 'spec/models/fabricators_spec.rb'
115   - - 'spec/models/notification_service/campfire_service_spec.rb'
116   - - 'spec/models/notification_service/gtalk_service_spec.rb'
117   - - 'spec/models/notification_service/hoiio_service_spec.rb'
118   - - 'spec/models/notification_service/pushover_service_spec.rb'
119   -
120 107 # Offense count: 10
121 108 # Cop supports --auto-correct.
122 109 # Configuration parameters: EnforcedStyle, SupportedStyles.
... ...
app/models/notification_services/gtalk_service.rb
... ... @@ -66,7 +66,7 @@ private
66 66 end
67 67  
68 68 def send_to_muc(client, message)
69   - #TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment
  69 + # TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment
70 70 muc = Jabber::MUC::SimpleMUCClient.new(client)
71 71 muc.join(room_id + "/errbit")
72 72 muc.send(Jabber::Message.new(room_id, message))
... ...
spec/controllers/api/v1/notices_controller_spec.rb
... ... @@ -14,7 +14,7 @@ describe Api::V1::NoticesController, type: 'controller' do
14 14  
15 15 it "should return JSON if JSON is requested" do
16 16 get :index, auth_token: @user.authentication_token, format: "json"
17   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError)
  17 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError)
18 18 end
19 19  
20 20 it "should return XML if XML is requested" do
... ... @@ -24,7 +24,7 @@ describe Api::V1::NoticesController, type: 'controller' do
24 24  
25 25 it "should return JSON by default" do
26 26 get :index, auth_token: @user.authentication_token
27   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError)
  27 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError)
28 28 end
29 29  
30 30 describe "given a date range" do
... ...
spec/controllers/api/v1/problems_controller_spec.rb
... ... @@ -13,7 +13,7 @@ describe Api::V1::ProblemsController, type: 'controller' do
13 13  
14 14 it "should return JSON if JSON is requested" do
15 15 get :show, auth_token: @user.authentication_token, format: "json", id: Problem.first.id
16   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError
  16 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError
17 17 end
18 18  
19 19 it "should return XML if XML is requested" do
... ... @@ -23,7 +23,7 @@ describe Api::V1::ProblemsController, type: 'controller' do
23 23  
24 24 it "should return JSON by default" do
25 25 get :show, auth_token: @user.authentication_token, id: @problem.id
26   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError)
  26 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError)
27 27 end
28 28  
29 29 it "should return the correct problem" do
... ... @@ -67,7 +67,7 @@ describe Api::V1::ProblemsController, type: 'controller' do
67 67  
68 68 it "should return JSON if JSON is requested" do
69 69 get :index, auth_token: @user.authentication_token, format: "json"
70   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError)
  70 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError)
71 71 end
72 72  
73 73 it "should return XML if XML is requested" do
... ... @@ -77,7 +77,7 @@ describe Api::V1::ProblemsController, type: 'controller' do
77 77  
78 78 it "should return JSON by default" do
79 79 get :index, auth_token: @user.authentication_token
80   - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError)
  80 + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError)
81 81 end
82 82  
83 83 describe "given a date range" do
... ...
spec/models/fabricators_spec.rb
... ... @@ -5,7 +5,7 @@ Fabrication::Config.fabricator_path.each do |folder|
5 5 end
6 6  
7 7 describe "Fabrication" do
8   - #TODO : when 1.8.7 drop support se directly Symbol#sort
  8 + # TODO : when 1.8.7 drop support se directly Symbol#sort
9 9 Fabrication.manager.schematics.keys.sort.each do |fabricator_name|
10 10 context "Fabricate(:#{fabricator_name})" do
11 11 subject { Fabricate.build(fabricator_name) }
... ...
spec/models/notification_service/campfire_service_spec.rb
... ... @@ -5,12 +5,12 @@ describe NotificationServices::CampfireService, type: 'model' do
5 5 notification_service = Fabricate :campfire_notification_service, app: notice.app
6 6 problem = notice.problem
7 7  
8   - #campy stubbing
  8 + # campy stubbing
9 9 campy = double('CampfireService')
10 10 allow(Campy::Room).to receive(:new).and_return(campy)
11 11 allow(campy).to receive(:speak).and_return(true)
12 12  
13   - #assert
  13 + # assert
14 14 expect(campy).to receive(:speak)
15 15  
16 16 notification_service.create_notification(problem)
... ...
spec/models/notification_service/gtalk_service_spec.rb
... ... @@ -6,7 +6,7 @@ describe NotificationServices::GtalkService, type: 'model' do
6 6 notification_service = Fabricate :gtalk_notification_service, app: notice.app
7 7 problem = notice.problem
8 8  
9   - #gtalk stubbing
  9 + # gtalk stubbing
10 10 gtalk = double('GtalkService')
11 11 jid = double("jid")
12 12 message = double("message")
... ... @@ -24,7 +24,7 @@ describe NotificationServices::GtalkService, type: 'model' do
24 24 expect(Jabber::MUC::SimpleMUCClient).to receive(:new).and_return(gtalk)
25 25 expect(gtalk).to receive(:join).with(notification_service.room_id + "/errbit")
26 26  
27   - #assert
  27 + # assert
28 28 expect(gtalk).to receive(:send).exactly(2).times.with(message)
29 29 expect(gtalk).to receive(:close)
30 30  
... ... @@ -97,7 +97,7 @@ describe NotificationServices::GtalkService, type: 'model' do
97 97 notification_service = Fabricate :gtalk_notification_service, app: notice.app
98 98 problem = notice.problem
99 99  
100   - #gtalk stubbing
  100 + # gtalk stubbing
101 101 gtalk = double('GtalkService')
102 102 jid = double("jid")
103 103 message = double("message")
... ... @@ -116,7 +116,7 @@ describe NotificationServices::GtalkService, type: 'model' do
116 116  
117 117 notification_service.user_id = ""
118 118  
119   - #assert
  119 + # assert
120 120 expect(gtalk).to receive(:send).with(message)
121 121 expect(gtalk).to receive(:close)
122 122  
... ...
spec/models/notification_service/hoiio_service_spec.rb
... ... @@ -10,7 +10,7 @@ describe NotificationServices::HoiioService, type: 'model' do
10 10 allow(Hoi::SMS).to receive(:new).and_return(sms)
11 11 allow(sms).to receive(:send).and_return(true)
12 12  
13   - #assert
  13 + # assert
14 14 expect(sms).to receive(:send)
15 15  
16 16 notification_service.create_notification(problem)
... ...
spec/models/notification_service/pushover_service_spec.rb
... ... @@ -10,7 +10,7 @@ describe NotificationServices::PushoverService, type: 'model' do
10 10 allow(Rushover::Client).to receive(:new).and_return(notification)
11 11 allow(notification).to receive(:notify).and_return(true)
12 12  
13   - #assert
  13 + # assert
14 14 expect(notification).to receive(:notify)
15 15  
16 16 notification_service.create_notification(problem)
... ...