From 998a721d7243ff0c480176d42f38587817f45070 Mon Sep 17 00:00:00 2001 From: Thomas Dziedzic Date: Wed, 15 Aug 2018 14:44:11 +0000 Subject: [PATCH] bump rubocop --- .rubocop.yml | 2 ++ Gemfile.lock | 14 ++++++++------ app/models/story.rb | 2 +- script/mail_new_activity | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d0bb74ae0..1a2b6483b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,8 +3,10 @@ Rails: Enabled: true AllCops: Include: + - '**/*.rb' - '**/Rakefile' - '**/config.ru' + - '**/*.rake' Exclude: - Gemfile - 'bin/**/*' diff --git a/Gemfile.lock b/Gemfile.lock index 95a4050a4..caa298602 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,7 @@ GEM htmlentities (4.3.4) i18n (1.1.0) concurrent-ruby (~> 1.0) + jaro_winkler (1.5.1) jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -116,9 +117,9 @@ GEM mini_portile2 (~> 2.3.0) oauth (0.5.4) parallel (1.12.1) - parser (2.5.0.5) + parser (2.5.1.2) ast (~> 2.4.0) - powerpack (0.1.1) + powerpack (0.1.2) public_suffix (3.0.2) rack (2.0.5) rack-test (1.1.0) @@ -174,16 +175,17 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) - rubocop (0.54.0) + rubocop (0.58.2) + jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.5) + parser (>= 2.5, != 2.5.1.1) powerpack (~> 0.1) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-enum (0.7.2) i18n - ruby-progressbar (1.9.0) + ruby-progressbar (1.10.0) ruby_dep (1.5.0) scenic (1.4.1) activerecord (>= 4.0.0) @@ -207,7 +209,7 @@ GEM thread_safe (~> 0.1) uglifier (4.1.18) execjs (>= 0.3.0, < 3) - unicode-display_width (1.3.0) + unicode-display_width (1.4.0) unicorn (5.4.1) kgio (~> 2.6) raindrops (~> 0.7) diff --git a/app/models/story.rb b/app/models/story.rb index c4f4b07e0..1ddcdfdae 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -704,7 +704,7 @@ def save_suggested_title_for_user!(title, user) title_votes[s.title] += 1 end - title_votes.sort_by {|_k, v| v }.reverse.each do |kv| + title_votes.sort_by {|_k, v| v }.reverse_each do |kv| if kv[1] >= SUGGESTION_QUORUM Rails.logger.info "[s#{self.id}] promoting suggested title " << "#{kv[0].inspect} instead of #{self.title.inspect}" diff --git a/script/mail_new_activity b/script/mail_new_activity index 1c4327071..dc0d4ed9f 100755 --- a/script/mail_new_activity +++ b/script/mail_new_activity @@ -186,7 +186,7 @@ Comment.where( thread = [] indent_level = 0 - Comment.where(:thread_id => c.thread_id).arrange_for_user(nil).reverse.each do |cc| + Comment.where(:thread_id => c.thread_id).arrange_for_user(nil).reverse_each do |cc| if indent_level > 0 && cc.indent_level < indent_level thread.unshift cc indent_level = cc.indent_level