Commit 9725017b232e2169b4722d8ffa0d1cc01d8dace5

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

Rubocop: strip spaces inside brackets

.rubocop_todo.yml
@@ -282,19 +282,6 @@ Style/SpaceBeforeBlockBraces: @@ -282,19 +282,6 @@ Style/SpaceBeforeBlockBraces:
282 Style/SpaceInsideBlockBraces: 282 Style/SpaceInsideBlockBraces:
283 Enabled: false 283 Enabled: false
284 284
285 -# Offense count: 26  
286 -# Cop supports --auto-correct.  
287 -Style/SpaceInsideBrackets:  
288 - Exclude:  
289 - - 'app/helpers/apps_helper.rb'  
290 - - 'app/models/issue.rb'  
291 - - 'app/models/notice_fingerprinter.rb'  
292 - - 'app/models/notification_services/gtalk_service.rb'  
293 - - 'config/initializers/devise.rb'  
294 - - 'lib/tasks/errbit/database.rake'  
295 - - 'spec/lib/configurator_spec.rb'  
296 - - 'spec/models/issue_spec.rb'  
297 -  
298 # Offense count: 873 285 # Offense count: 873
299 # Cop supports --auto-correct. 286 # Cop supports --auto-correct.
300 # Configuration parameters: EnforcedStyle, SupportedStyles. 287 # Configuration parameters: EnforcedStyle, SupportedStyles.
app/helpers/apps_helper.rb
@@ -5,7 +5,7 @@ module AppsHelper @@ -5,7 +5,7 @@ module AppsHelper
5 :class => 'button copy_config') 5 :class => 'button copy_config')
6 html << select("duplicate", "app", 6 html << select("duplicate", "app",
7 App.all.asc(:name).reject{|a| a == @app }. 7 App.all.asc(:name).reject{|a| a == @app }.
8 - collect{|p| [ p.name, p.id ] }, { :include_blank => "[choose app]" }, 8 + collect{|p| [p.name, p.id] }, { :include_blank => "[choose app]" },
9 { :class => "choose_other_app", :style => "display: none;" }) 9 { :class => "choose_other_app", :style => "display: none;" })
10 return html 10 return html
11 end 11 end
app/models/issue.rb
@@ -14,7 +14,7 @@ class Issue @@ -14,7 +14,7 @@ class Issue
14 if tracker.respond_to?(:render_body_args) 14 if tracker.respond_to?(:render_body_args)
15 tracker.render_body_args 15 tracker.render_body_args
16 else 16 else
17 - [ 'issue_trackers/issue', formats: [:md] ] 17 + ['issue_trackers/issue', formats: [:md]]
18 end 18 end
19 end 19 end
20 20
app/models/notice_fingerprinter.rb
@@ -14,7 +14,7 @@ class NoticeFingerprinter @@ -14,7 +14,7 @@ class NoticeFingerprinter
14 embedded_in :site_config 14 embedded_in :site_config
15 15
16 def generate(api_key, notice, backtrace) 16 def generate(api_key, notice, backtrace)
17 - material = [ api_key ] 17 + material = [api_key]
18 material << notice.error_class if error_class 18 material << notice.error_class if error_class
19 material << notice.filtered_message if message 19 material << notice.filtered_message if message
20 material << notice.component if component 20 material << notice.component if component
app/models/notification_services/gtalk_service.rb
@@ -17,11 +17,11 @@ class NotificationServices::GtalkService &lt; NotificationService @@ -17,11 +17,11 @@ class NotificationServices::GtalkService &lt; NotificationService
17 :placeholder => "toroom@conference.example.com", 17 :placeholder => "toroom@conference.example.com",
18 :label => "Send To Room (one only)" 18 :label => "Send To Room (one only)"
19 }, :user_id], 19 }, :user_id],
20 - [ :service, { 20 + [:service, {
21 :placeholder => "talk.google.com", 21 :placeholder => "talk.google.com",
22 :label => "Jabber Service" 22 :label => "Jabber Service"
23 }], 23 }],
24 - [ :service_url, { 24 + [:service_url, {
25 :placeholder => "http://www.google.com/talk/", 25 :placeholder => "http://www.google.com/talk/",
26 :label => "Link To Jabber Service" 26 :label => "Link To Jabber Service"
27 }] 27 }]
config/initializers/devise.rb
@@ -29,7 +29,7 @@ Devise.setup do |config| @@ -29,7 +29,7 @@ Devise.setup do |config|
29 # session. If you need permissions, you should implement that in a before filter. 29 # session. If you need permissions, you should implement that in a before filter.
30 # You can also supply a hash where the value is a boolean determining whether 30 # You can also supply a hash where the value is a boolean determining whether
31 # or not authentication should be aborted when the value is not present. 31 # or not authentication should be aborted when the value is not present.
32 - config.authentication_keys = [ Errbit::Config.user_has_username ? :username : :email ] 32 + config.authentication_keys = [Errbit::Config.user_has_username ? :username : :email]
33 33
34 # Configure parameters from the request object used for authentication. Each entry 34 # Configure parameters from the request object used for authentication. Each entry
35 # given should be a request method and it will automatically be passed to the 35 # given should be a request method and it will automatically be passed to the
@@ -41,12 +41,12 @@ Devise.setup do |config| @@ -41,12 +41,12 @@ Devise.setup do |config|
41 # Configure which authentication keys should be case-insensitive. 41 # Configure which authentication keys should be case-insensitive.
42 # These keys will be downcased upon creating or modifying a user and when used 42 # These keys will be downcased upon creating or modifying a user and when used
43 # to authenticate or find a user. Default is :email. 43 # to authenticate or find a user. Default is :email.
44 - config.case_insensitive_keys = [ Errbit::Config.user_has_username ? :username : :email ] 44 + config.case_insensitive_keys = [Errbit::Config.user_has_username ? :username : :email]
45 45
46 # Configure which authentication keys should have whitespace stripped. 46 # Configure which authentication keys should have whitespace stripped.
47 # These keys will have whitespace before and after removed upon creating or 47 # These keys will have whitespace before and after removed upon creating or
48 # modifying a user and when used to authenticate or find a user. Default is :email. 48 # modifying a user and when used to authenticate or find a user. Default is :email.
49 - config.strip_whitespace_keys = [ Errbit::Config.user_has_username ? :username : :email ] 49 + config.strip_whitespace_keys = [Errbit::Config.user_has_username ? :username : :email]
50 50
51 # Tell if authentication through request.params is enabled. True by default. 51 # Tell if authentication through request.params is enabled. True by default.
52 # It can be set to an array that will enable params authentication only for the 52 # It can be set to an array that will enable params authentication only for the
lib/tasks/errbit/database.rake
@@ -17,7 +17,7 @@ namespace :errbit do @@ -17,7 +17,7 @@ namespace :errbit do
17 end 17 end
18 18
19 desc "Remove notices in batch" 19 desc "Remove notices in batch"
20 - task :notices_delete, [ :problem_id ] => [ :environment ] do 20 + task :notices_delete, [:problem_id] => [:environment] do
21 BATCH_SIZE = 1000 21 BATCH_SIZE = 1000
22 if args[:problem_id] 22 if args[:problem_id]
23 item_count = Problem.find(args[:problem_id]).notices.count 23 item_count = Problem.find(args[:problem_id]).notices.count
spec/lib/configurator_spec.rb
@@ -22,15 +22,15 @@ describe Configurator do @@ -22,15 +22,15 @@ describe Configurator do
22 22
23 it 'overrides existing variables' do 23 it 'overrides existing variables' do
24 result = Configurator.run({ 24 result = Configurator.run({
25 - one: ['VARONE', ->(_values) { 'oveRIIIDE' } ] 25 + one: ['VARONE', ->(_values) { 'oveRIIIDE' }]
26 }) 26 })
27 expect(result.one).to eq('oveRIIIDE') 27 expect(result.one).to eq('oveRIIIDE')
28 end 28 end
29 29
30 it 'overrides can refer to other values' do 30 it 'overrides can refer to other values' do
31 result = Configurator.run({ 31 result = Configurator.run({
32 - one: ['VARONE', ->(values) { values[:one] } ],  
33 - three: ['VARTHREE' ] 32 + one: ['VARONE', ->(values) { values[:one] }],
  33 + three: ['VARTHREE']
34 }) 34 })
35 expect(result.one).to eq('zoom') 35 expect(result.one).to eq('zoom')
36 end 36 end
spec/models/issue_spec.rb
@@ -51,14 +51,14 @@ describe Issue, type: &#39;model&#39; do @@ -51,14 +51,14 @@ describe Issue, type: &#39;model&#39; do
51 context "#render_body_args" do 51 context "#render_body_args" do
52 it "returns custom args if they exist" do 52 it "returns custom args if they exist" do
53 allow(issue.tracker).to receive(:render_body_args).and_return( 53 allow(issue.tracker).to receive(:render_body_args).and_return(
54 - [ 'my', { custom: 'args' } ] 54 + ['my', { custom: 'args' }]
55 ) 55 )
56 - expect(issue.render_body_args).to eq [ 'my', { custom: 'args' } ] 56 + expect(issue.render_body_args).to eq ['my', { custom: 'args' }]
57 end 57 end
58 58
59 it "returns default args if none exist" do 59 it "returns default args if none exist" do
60 expect(issue.render_body_args).to eq [ 60 expect(issue.render_body_args).to eq [
61 - 'issue_trackers/issue', formats: [:md] ] 61 + 'issue_trackers/issue', formats: [:md]]
62 end 62 end
63 end 63 end
64 64