From 086f0dc69702573786165448ba9a13b87582915d Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Sun, 15 Nov 2015 17:58:12 +0100 Subject: [PATCH] Rubocop: for multi-line operations, indent subsequent lines a level --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 6 ------ app/decorators/backtrace_line_decorator.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/models/app.rb | 4 ++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5344793..511c039 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,6 +33,9 @@ Style/DotPosition: # Support code copy/paste into console EnforcedStyle: trailing +Style/MultilineOperationIndentation: + EnforcedStyle: indented + Style/IndentHash: EnforcedStyle: consistent diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c576b60..653a973 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -104,12 +104,6 @@ Style/IfUnlessModifier: - 'app/models/notice.rb' - 'app/models/user.rb' -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/MultilineOperationIndentation: - Enabled: false - # Offense count: 873 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/decorators/backtrace_line_decorator.rb b/app/decorators/backtrace_line_decorator.rb index c7d87b3..f576fe4 100644 --- a/app/decorators/backtrace_line_decorator.rb +++ b/app/decorators/backtrace_line_decorator.rb @@ -57,7 +57,7 @@ private link_to_hosted_javascript(app, text) else link_to_repo_source_file(app, text) || - link_to_issue_tracker_file(app, text) + link_to_issue_tracker_file(app, text) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e8b38c3..12052be 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -57,7 +57,7 @@ module ApplicationHelper total = (options[:total] || total_from_tallies(tallies)) percent = 100.0 / total.to_f rows = tallies.map { |value, count| [(count.to_f * percent), value] }. \ - sort { |a, b| b[0] <=> a[0] } + sort { |a, b| b[0] <=> a[0] } render "problems/tally_table", rows: rows end diff --git a/app/models/app.rb b/app/models/app.rb index 92929eb..96f62bc 100644 --- a/app/models/app.rb +++ b/app/models/app.rb @@ -177,8 +177,8 @@ class App # Compare by number of unresolved errs, then problem counts. def <=>(other) (other.unresolved_count <=> unresolved_count).nonzero? || - (other.problem_count <=> problem_count).nonzero? || - name <=> other.name + (other.problem_count <=> problem_count).nonzero? || + name <=> other.name end def email_at_notices -- libgit2 0.21.2