Commit f1f39cdcf1772615e313dbd4d23462fd1f1d676b
1 parent
47b11978
Exists in
master
and in
1 other branch
Rubocop: consistently indenting private/protected with method defs
That's what the majority of the codebase is using, so following that
Showing
12 changed files
with
22 additions
and
36 deletions
Show diff stats
.rubocop_todo.yml
| 1 | # This configuration was generated by | 1 | # This configuration was generated by |
| 2 | # `rubocop --auto-gen-config` | 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 | # The point is for the user to remove these configuration records | 4 | # The point is for the user to remove these configuration records |
| 5 | # one by one as the offenses are removed from the code base. | 5 | # one by one as the offenses are removed from the code base. |
| 6 | # Note that changes in the inspected code, or installation of new | 6 | # Note that changes in the inspected code, or installation of new |
| @@ -82,12 +82,6 @@ Rails/Validation: | @@ -82,12 +82,6 @@ Rails/Validation: | ||
| 82 | - 'app/models/problem.rb' | 82 | - 'app/models/problem.rb' |
| 83 | - 'app/models/user.rb' | 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 | # Offense count: 8 | 85 | # Offense count: 8 |
| 92 | # Cop supports --auto-correct. | 86 | # Cop supports --auto-correct. |
| 93 | # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. | 87 | # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. |
| @@ -232,12 +226,11 @@ Style/EmptyLineBetweenDefs: | @@ -232,12 +226,11 @@ Style/EmptyLineBetweenDefs: | ||
| 232 | - 'spec/decorators/issue_tracker_type_decorator_spec.rb' | 226 | - 'spec/decorators/issue_tracker_type_decorator_spec.rb' |
| 233 | - 'spec/views/problems/show.html.haml_spec.rb' | 227 | - 'spec/views/problems/show.html.haml_spec.rb' |
| 234 | 228 | ||
| 235 | -# Offense count: 13 | 229 | +# Offense count: 12 |
| 236 | # Cop supports --auto-correct. | 230 | # Cop supports --auto-correct. |
| 237 | Style/EmptyLines: | 231 | Style/EmptyLines: |
| 238 | Exclude: | 232 | Exclude: |
| 239 | - 'app/controllers/api/v1/stats_controller.rb' | 233 | - 'app/controllers/api/v1/stats_controller.rb' |
| 240 | - - 'app/controllers/application_controller.rb' | ||
| 241 | - 'app/decorators/issue_tracker_field_decorator.rb' | 234 | - 'app/decorators/issue_tracker_field_decorator.rb' |
| 242 | - 'app/models/app.rb' | 235 | - 'app/models/app.rb' |
| 243 | - 'app/models/problem.rb' | 236 | - 'app/models/problem.rb' |
| @@ -246,20 +239,6 @@ Style/EmptyLines: | @@ -246,20 +239,6 @@ Style/EmptyLines: | ||
| 246 | - 'script/rspec-queue-mongoid.rb' | 239 | - 'script/rspec-queue-mongoid.rb' |
| 247 | - 'spec/acceptance/app_regenerate_api_key_spec.rb' | 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 | # Offense count: 28 | 242 | # Offense count: 28 |
| 264 | # Cop supports --auto-correct. | 243 | # Cop supports --auto-correct. |
| 265 | # Configuration parameters: EnforcedStyle, SupportedStyles. | 244 | # Configuration parameters: EnforcedStyle, SupportedStyles. |
| @@ -377,13 +356,6 @@ Style/IndentationConsistency: | @@ -377,13 +356,6 @@ Style/IndentationConsistency: | ||
| 377 | - 'app/models/watcher.rb' | 356 | - 'app/models/watcher.rb' |
| 378 | - 'lib/hoptoad.rb' | 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 | # Offense count: 6 | 359 | # Offense count: 6 |
| 388 | # Cop supports --auto-correct. | 360 | # Cop supports --auto-correct. |
| 389 | Style/Lambda: | 361 | Style/Lambda: |
| @@ -473,9 +445,15 @@ Style/Proc: | @@ -473,9 +445,15 @@ Style/Proc: | ||
| 473 | - 'app/models/problem.rb' | 445 | - 'app/models/problem.rb' |
| 474 | 446 | ||
| 475 | # Offense count: 2 | 447 | # Offense count: 2 |
| 476 | -# Configuration parameters: SupportedStyles. | 448 | +# Configuration parameters: EnforcedStyle, SupportedStyles. |
| 477 | Style/RaiseArgs: | 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 | # Offense count: 13 | 458 | # Offense count: 13 |
| 481 | # Cop supports --auto-correct. | 459 | # Cop supports --auto-correct. |
app/controllers/application_controller.rb
| @@ -17,8 +17,7 @@ class ApplicationController < ActionController::Base | @@ -17,8 +17,7 @@ class ApplicationController < ActionController::Base | ||
| 17 | strategy StrongParametersWithEagerAttributesStrategy | 17 | strategy StrongParametersWithEagerAttributesStrategy |
| 18 | end | 18 | end |
| 19 | 19 | ||
| 20 | -protected | ||
| 21 | - | 20 | + protected |
| 22 | 21 | ||
| 23 | ## | 22 | ## |
| 24 | # Check if the current_user is admin or not and redirect to root url if not | 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,6 +142,7 @@ class AppsController < ApplicationController | ||
| 142 | end | 142 | end |
| 143 | 143 | ||
| 144 | private | 144 | private |
| 145 | + | ||
| 145 | def app_params | 146 | def app_params |
| 146 | params.require(:app).permit! | 147 | params.require(:app).permit! |
| 147 | end | 148 | end |
app/controllers/comments_controller.rb
| @@ -25,6 +25,7 @@ class CommentsController < ApplicationController | @@ -25,6 +25,7 @@ class CommentsController < ApplicationController | ||
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | protected | 27 | protected |
| 28 | + | ||
| 28 | def find_app | 29 | def find_app |
| 29 | @app = App.find(params[:app_id]) | 30 | @app = App.find(params[:app_id]) |
| 30 | end | 31 | end |
app/controllers/notices_controller.rb
| @@ -15,7 +15,7 @@ class NoticesController < ApplicationController | @@ -15,7 +15,7 @@ class NoticesController < ApplicationController | ||
| 15 | if report.should_keep? | 15 | if report.should_keep? |
| 16 | report.generate_notice! | 16 | report.generate_notice! |
| 17 | api_xml = report.notice.to_xml(:only => false, :methods => [:id]) do |xml| | 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 | end | 19 | end |
| 20 | render :xml => api_xml | 20 | render :xml => api_xml |
| 21 | else | 21 | else |
app/decorators/backtrace_line_decorator.rb
| @@ -50,6 +50,7 @@ class BacktraceLineDecorator < Draper::Decorator | @@ -50,6 +50,7 @@ class BacktraceLineDecorator < Draper::Decorator | ||
| 50 | end | 50 | end |
| 51 | 51 | ||
| 52 | private | 52 | private |
| 53 | + | ||
| 53 | def link_to_in_app_source_file(app, text) | 54 | def link_to_in_app_source_file(app, text) |
| 54 | return unless in_app? | 55 | return unless in_app? |
| 55 | if file_name =~ /\.js$/ | 56 | if file_name =~ /\.js$/ |
app/helpers/application_helper.rb
| @@ -76,6 +76,7 @@ module ApplicationHelper | @@ -76,6 +76,7 @@ module ApplicationHelper | ||
| 76 | end | 76 | end |
| 77 | 77 | ||
| 78 | private | 78 | private |
| 79 | + | ||
| 79 | def total_from_tallies(tallies) | 80 | def total_from_tallies(tallies) |
| 80 | tallies.values.inject(0) {|sum, n| sum + n} | 81 | tallies.values.inject(0) {|sum, n| sum + n} |
| 81 | end | 82 | end |
app/models/backtrace.rb
| @@ -23,6 +23,7 @@ class Backtrace | @@ -23,6 +23,7 @@ class Backtrace | ||
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | private | 25 | private |
| 26 | + | ||
| 26 | def generate_fingerprint | 27 | def generate_fingerprint |
| 27 | self.fingerprint = self.class.generate_fingerprint(lines) | 28 | self.fingerprint = self.class.generate_fingerprint(lines) |
| 28 | end | 29 | end |
app/models/comment.rb
lib/hoptoad.rb
lib/hoptoad/v2.rb
lib/overrides/hoptoad_notifier/hoptoad_notifier.rb
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | HoptoadNotifier.module_eval do | 5 | HoptoadNotifier.module_eval do |
| 6 | class << self | 6 | class << self |
| 7 | private | 7 | private |
| 8 | + | ||
| 8 | def send_notice(notice) | 9 | def send_notice(notice) |
| 9 | # Log the error internally if we are not in a development environment. | 10 | # Log the error internally if we are not in a development environment. |
| 10 | if configuration.public? | 11 | if configuration.public? |