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 282 Style/SpaceInsideBlockBraces:
283 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 285 # Offense count: 873
299 286 # Cop supports --auto-correct.
300 287 # Configuration parameters: EnforcedStyle, SupportedStyles.
... ...
app/helpers/apps_helper.rb
... ... @@ -5,7 +5,7 @@ module AppsHelper
5 5 :class => 'button copy_config')
6 6 html << select("duplicate", "app",
7 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 9 { :class => "choose_other_app", :style => "display: none;" })
10 10 return html
11 11 end
... ...
app/models/issue.rb
... ... @@ -14,7 +14,7 @@ class Issue
14 14 if tracker.respond_to?(:render_body_args)
15 15 tracker.render_body_args
16 16 else
17   - [ 'issue_trackers/issue', formats: [:md] ]
  17 + ['issue_trackers/issue', formats: [:md]]
18 18 end
19 19 end
20 20  
... ...
app/models/notice_fingerprinter.rb
... ... @@ -14,7 +14,7 @@ class NoticeFingerprinter
14 14 embedded_in :site_config
15 15  
16 16 def generate(api_key, notice, backtrace)
17   - material = [ api_key ]
  17 + material = [api_key]
18 18 material << notice.error_class if error_class
19 19 material << notice.filtered_message if message
20 20 material << notice.component if component
... ...
app/models/notification_services/gtalk_service.rb
... ... @@ -17,11 +17,11 @@ class NotificationServices::GtalkService &lt; NotificationService
17 17 :placeholder => "toroom@conference.example.com",
18 18 :label => "Send To Room (one only)"
19 19 }, :user_id],
20   - [ :service, {
  20 + [:service, {
21 21 :placeholder => "talk.google.com",
22 22 :label => "Jabber Service"
23 23 }],
24   - [ :service_url, {
  24 + [:service_url, {
25 25 :placeholder => "http://www.google.com/talk/",
26 26 :label => "Link To Jabber Service"
27 27 }]
... ...
config/initializers/devise.rb
... ... @@ -29,7 +29,7 @@ Devise.setup do |config|
29 29 # session. If you need permissions, you should implement that in a before filter.
30 30 # You can also supply a hash where the value is a boolean determining whether
31 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 34 # Configure parameters from the request object used for authentication. Each entry
35 35 # given should be a request method and it will automatically be passed to the
... ... @@ -41,12 +41,12 @@ Devise.setup do |config|
41 41 # Configure which authentication keys should be case-insensitive.
42 42 # These keys will be downcased upon creating or modifying a user and when used
43 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 46 # Configure which authentication keys should have whitespace stripped.
47 47 # These keys will have whitespace before and after removed upon creating or
48 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 51 # Tell if authentication through request.params is enabled. True by default.
52 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 17 end
18 18  
19 19 desc "Remove notices in batch"
20   - task :notices_delete, [ :problem_id ] => [ :environment ] do
  20 + task :notices_delete, [:problem_id] => [:environment] do
21 21 BATCH_SIZE = 1000
22 22 if args[:problem_id]
23 23 item_count = Problem.find(args[:problem_id]).notices.count
... ...
spec/lib/configurator_spec.rb
... ... @@ -22,15 +22,15 @@ describe Configurator do
22 22  
23 23 it 'overrides existing variables' do
24 24 result = Configurator.run({
25   - one: ['VARONE', ->(_values) { 'oveRIIIDE' } ]
  25 + one: ['VARONE', ->(_values) { 'oveRIIIDE' }]
26 26 })
27 27 expect(result.one).to eq('oveRIIIDE')
28 28 end
29 29  
30 30 it 'overrides can refer to other values' do
31 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 35 expect(result.one).to eq('zoom')
36 36 end
... ...
spec/models/issue_spec.rb
... ... @@ -51,14 +51,14 @@ describe Issue, type: &#39;model&#39; do
51 51 context "#render_body_args" do
52 52 it "returns custom args if they exist" do
53 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 57 end
58 58  
59 59 it "returns default args if none exist" do
60 60 expect(issue.render_body_args).to eq [
61   - 'issue_trackers/issue', formats: [:md] ]
  61 + 'issue_trackers/issue', formats: [:md]]
62 62 end
63 63 end
64 64  
... ...