Commit f1f39cdcf1772615e313dbd4d23462fd1f1d676b

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

Rubocop: consistently indenting private/protected with method defs

That's what the majority of the codebase is using, so following that
.rubocop_todo.yml
1 1 # This configuration was generated by
2 2 # `rubocop --auto-gen-config`
3   -# on 2015-10-12 09:35:47 +0200 using RuboCop version 0.34.2.
  3 +# on 2015-10-12 21:40:12 +0200 using RuboCop version 0.34.2.
4 4 # The point is for the user to remove these configuration records
5 5 # one by one as the offenses are removed from the code base.
6 6 # Note that changes in the inspected code, or installation of new
... ... @@ -82,12 +82,6 @@ Rails/Validation:
82 82 - 'app/models/problem.rb'
83 83 - 'app/models/user.rb'
84 84  
85   -# Offense count: 2
86   -# Cop supports --auto-correct.
87   -# Configuration parameters: EnforcedStyle, SupportedStyles.
88   -Style/AccessModifierIndentation:
89   - Enabled: false
90   -
91 85 # Offense count: 8
92 86 # Cop supports --auto-correct.
93 87 # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
... ... @@ -232,12 +226,11 @@ Style/EmptyLineBetweenDefs:
232 226 - 'spec/decorators/issue_tracker_type_decorator_spec.rb'
233 227 - 'spec/views/problems/show.html.haml_spec.rb'
234 228  
235   -# Offense count: 13
  229 +# Offense count: 12
236 230 # Cop supports --auto-correct.
237 231 Style/EmptyLines:
238 232 Exclude:
239 233 - 'app/controllers/api/v1/stats_controller.rb'
240   - - 'app/controllers/application_controller.rb'
241 234 - 'app/decorators/issue_tracker_field_decorator.rb'
242 235 - 'app/models/app.rb'
243 236 - 'app/models/problem.rb'
... ... @@ -246,20 +239,6 @@ Style/EmptyLines:
246 239 - 'script/rspec-queue-mongoid.rb'
247 240 - 'spec/acceptance/app_regenerate_api_key_spec.rb'
248 241  
249   -# Offense count: 9
250   -# Cop supports --auto-correct.
251   -Style/EmptyLinesAroundAccessModifier:
252   - Exclude:
253   - - 'app/controllers/apps_controller.rb'
254   - - 'app/controllers/comments_controller.rb'
255   - - 'app/decorators/backtrace_line_decorator.rb'
256   - - 'app/helpers/application_helper.rb'
257   - - 'app/models/backtrace.rb'
258   - - 'app/models/comment.rb'
259   - - 'lib/hoptoad.rb'
260   - - 'lib/hoptoad/v2.rb'
261   - - 'lib/overrides/hoptoad_notifier/hoptoad_notifier.rb'
262   -
263 242 # Offense count: 28
264 243 # Cop supports --auto-correct.
265 244 # Configuration parameters: EnforcedStyle, SupportedStyles.
... ... @@ -377,13 +356,6 @@ Style/IndentationConsistency:
377 356 - 'app/models/watcher.rb'
378 357 - 'lib/hoptoad.rb'
379 358  
380   -# Offense count: 1
381   -# Cop supports --auto-correct.
382   -# Configuration parameters: Width.
383   -Style/IndentationWidth:
384   - Exclude:
385   - - 'app/controllers/notices_controller.rb'
386   -
387 359 # Offense count: 6
388 360 # Cop supports --auto-correct.
389 361 Style/Lambda:
... ... @@ -473,9 +445,15 @@ Style/Proc:
473 445 - 'app/models/problem.rb'
474 446  
475 447 # Offense count: 2
476   -# Configuration parameters: SupportedStyles.
  448 +# Configuration parameters: EnforcedStyle, SupportedStyles.
477 449 Style/RaiseArgs:
478   - EnforcedStyle: compact
  450 + Enabled: false
  451 +
  452 +# Offense count: 1
  453 +# Cop supports --auto-correct.
  454 +Style/RedundantException:
  455 + Exclude:
  456 + - 'Gemfile'
479 457  
480 458 # Offense count: 13
481 459 # Cop supports --auto-correct.
... ...
app/controllers/application_controller.rb
... ... @@ -17,8 +17,7 @@ class ApplicationController < ActionController::Base
17 17 strategy StrongParametersWithEagerAttributesStrategy
18 18 end
19 19  
20   -protected
21   -
  20 + protected
22 21  
23 22 ##
24 23 # Check if the current_user is admin or not and redirect to root url if not
... ...
app/controllers/apps_controller.rb
... ... @@ -142,6 +142,7 @@ class AppsController < ApplicationController
142 142 end
143 143  
144 144 private
  145 +
145 146 def app_params
146 147 params.require(:app).permit!
147 148 end
... ...
app/controllers/comments_controller.rb
... ... @@ -25,6 +25,7 @@ class CommentsController < ApplicationController
25 25 end
26 26  
27 27 protected
  28 +
28 29 def find_app
29 30 @app = App.find(params[:app_id])
30 31 end
... ...
app/controllers/notices_controller.rb
... ... @@ -15,7 +15,7 @@ class NoticesController < ApplicationController
15 15 if report.should_keep?
16 16 report.generate_notice!
17 17 api_xml = report.notice.to_xml(:only => false, :methods => [:id]) do |xml|
18   - xml.url locate_url(report.notice.id, :host => Errbit::Config.host)
  18 + xml.url locate_url(report.notice.id, :host => Errbit::Config.host)
19 19 end
20 20 render :xml => api_xml
21 21 else
... ...
app/decorators/backtrace_line_decorator.rb
... ... @@ -50,6 +50,7 @@ class BacktraceLineDecorator < Draper::Decorator
50 50 end
51 51  
52 52 private
  53 +
53 54 def link_to_in_app_source_file(app, text)
54 55 return unless in_app?
55 56 if file_name =~ /\.js$/
... ...
app/helpers/application_helper.rb
... ... @@ -76,6 +76,7 @@ module ApplicationHelper
76 76 end
77 77  
78 78 private
  79 +
79 80 def total_from_tallies(tallies)
80 81 tallies.values.inject(0) {|sum, n| sum + n}
81 82 end
... ...
app/models/backtrace.rb
... ... @@ -23,6 +23,7 @@ class Backtrace
23 23 end
24 24  
25 25 private
  26 +
26 27 def generate_fingerprint
27 28 self.fingerprint = self.class.generate_fingerprint(lines)
28 29 end
... ...
app/models/comment.rb
... ... @@ -29,6 +29,7 @@ class Comment
29 29 end
30 30  
31 31 protected
  32 +
32 33 def increase_counter_cache
33 34 err.inc(comments_count: 1)
34 35 end
... ...
lib/hoptoad.rb
... ... @@ -14,6 +14,7 @@ module Hoptoad
14 14 end
15 15  
16 16 private
  17 +
17 18 def self.get_version_processor(version)
18 19 case version
19 20 when /2\.[01234]/; Hoptoad::V2
... ...
lib/hoptoad/v2.rb
... ... @@ -6,7 +6,8 @@ module Hoptoad
6 6 rekey(parsed)))
7 7 end
8 8  
9   - private
  9 + private
  10 +
10 11 def self.rekey(node)
11 12 case node
12 13 when Hash
... ...
lib/overrides/hoptoad_notifier/hoptoad_notifier.rb
... ... @@ -5,6 +5,7 @@
5 5 HoptoadNotifier.module_eval do
6 6 class << self
7 7 private
  8 +
8 9 def send_notice(notice)
9 10 # Log the error internally if we are not in a development environment.
10 11 if configuration.public?
... ...