Update Rubocop to 0.60

Update Rubocop to 0.60

From 3c9c95ac837b1222c2dce43294dd69912a4f43f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Hanol?= <regis@hanol.fr>
Date: Tue, 4 Dec 2018 10:48:16 +0100
Subject: [PATCH] Update Rubocop to 0.60


diff --git a/.rubocop.yml b/.rubocop.yml
index 9f2254d..9d2e219 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -120,4 +120,4 @@ Style/SingleLineMethods:
 
 Style/Semicolon:
   Enabled: true
-  AllowAsExpressionSeparator: true
\ No newline at end of file
+  AllowAsExpressionSeparator: true
diff --git a/Gemfile.lock b/Gemfile.lock
index daefc70..78de3e3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -270,7 +270,7 @@ GEM
       redis
       ruby-openid
     parallel (1.12.1)
-    parser (2.5.1.0)
+    parser (2.5.3.0)
       ast (~> 2.4.0)
     pg (1.1.3)
     powerpack (0.1.2)
@@ -357,17 +357,17 @@ GEM
       rspec-support (~> 3.7.0)
     rspec-support (3.7.1)
     rtlit (0.0.5)
-    rubocop (0.57.2)
+    rubocop (0.60.0)
       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)
+      unicode-display_width (~> 1.4.0)
     ruby-openid (2.7.0)
     ruby-prof (0.17.0)
-    ruby-progressbar (1.9.0)
+    ruby-progressbar (1.10.0)
     ruby-readability (0.7.0)
       guess_html_encoding (>= 0.0.4)
       nokogiri (>= 1.6.0)
diff --git a/app/controllers/queued_posts_controller.rb b/app/controllers/queued_posts_controller.rb
index 6b31c14..6b9dadb 100644
--- a/app/controllers/queued_posts_controller.rb
+++ b/app/controllers/queued_posts_controller.rb
@@ -54,8 +54,8 @@ class QueuedPostsController < ApplicationController
 
   def user_deletion_opts
     base = {
-      context:           I18n.t('queue.delete_reason', performed_by: current_user.username),
-      delete_posts:      true,
+      context: I18n.t('queue.delete_reason', performed_by: current_user.username),
+      delete_posts: true,
       delete_as_spammer: true
     }
 
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index 42d1ffe..c2f4f3a 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.rb
@@ -40,7 +40,7 @@ class SiteController < ApplicationController
       logo_url: UrlHelper.absolute(SiteSetting.site_logo_url),
       logo_small_url: UrlHelper.absolute(SiteSetting.site_logo_small_url),
       apple_touch_icon_url: UrlHelper.absolute(SiteSetting.site_apple_touch_icon_url),
-      favicon_url:  UrlHelper.absolute(SiteSetting.site_favicon_url),
+      favicon_url: UrlHelper.absolute(SiteSetting.site_favicon_url),
       title: SiteSetting.title,
       description: SiteSetting.site_description,
       header_primary_color: ColorScheme.hex_for_name('header_primary') || '333333',
diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb
index d32e2b8..4026dc7 100644
--- a/app/jobs/regular/export_csv_file.rb
+++ b/app/jobs/regular/export_csv_file.rb
@@ -10,16 +10,16 @@ module Jobs
     sidekiq_options retry: false
 
     HEADER_ATTRS_FOR ||= HashWithIndifferentAccess.new(
-      user_archive:   ['topic_title', 'category', 'sub_category', 'is_pm', 'post', 'like_count', 'reply_count', 'url', 'created_at'],
-      user_list:      ['id', 'name', 'username', 'email', 'title', 'created_at', 'last_seen_at', 'last_posted_at', 'last_emailed_at', 'trust_level', 'approved', 'suspended_at', 'suspended_till', 'silenced_till', 'active', 'admin', 'moderator', 'ip_address', 'staged'],
-      user_stats:     ['topics_entered', 'posts_read_count', 'time_read', 'topic_count', 'post_count', 'likes_given', 'likes_received'],
-      user_profile:   ['location', 'website', 'views'],
-      user_sso:       ['external_id', 'external_email', 'external_username', 'external_name', 'external_avatar_url'],
-      staff_action:   ['staff_user', 'action', 'subject', 'created_at', 'details', 'context'],
+      user_archive: ['topic_title', 'category', 'sub_category', 'is_pm', 'post', 'like_count', 'reply_count', 'url', 'created_at'],
+      user_list: ['id', 'name', 'username', 'email', 'title', 'created_at', 'last_seen_at', 'last_posted_at', 'last_emailed_at', 'trust_level', 'approved', 'suspended_at', 'suspended_till', 'silenced_till', 'active', 'admin', 'moderator', 'ip_address', 'staged'],
+      user_stats: ['topics_entered', 'posts_read_count', 'time_read', 'topic_count', 'post_count', 'likes_given', 'likes_received'],
+      user_profile: ['location', 'website', 'views'],
+      user_sso: ['external_id', 'external_email', 'external_username', 'external_name', 'external_avatar_url'],
+      staff_action: ['staff_user', 'action', 'subject', 'created_at', 'details', 'context'],
       screened_email: ['email', 'action', 'match_count', 'last_match_at', 'created_at', 'ip_address'],
-      screened_ip:    ['ip_address', 'action', 'match_count', 'last_match_at', 'created_at'],
-      screened_url:   ['domain', 'action', 'match_count', 'last_match_at', 'created_at'],
-      report:         ['date', 'value']
+      screened_ip: ['ip_address', 'action', 'match_count', 'last_match_at', 'created_at'],
+      screened_url: ['domain', 'action', 'match_count', 'last_match_at', 'created_at'],
+      report: ['date', 'value']
     )
 
     def execute(args)
diff --git a/app/models/category_user.rb b/app/models/category_user.rb
index bccd7cb..5a87b68 100644
--- a/app/models/category_user.rb
+++ b/app/models/category_user.rb
@@ -97,7 +97,7 @@ class CategoryUser < ActiveRecord::Base
     builder.exec(
       tracking: notification_levels[:tracking],
       regular: notification_levels[:regular],
-      auto_track_category:  TopicUser.notification_reasons[:auto_track_category]
+      auto_track_category: TopicUser.notification_reasons[:auto_track_category]
     )
   end
 
@@ -157,7 +157,7 @@ class CategoryUser < ActiveRecord::Base
       watching: notification_levels[:watching],
       tracking: notification_levels[:tracking],
       regular: notification_levels[:regular],
-      auto_watch_category:  TopicUser.notification_reasons[:auto_watch_category]
+      auto_watch_category: TopicUser.notification_reasons[:auto_watch_category]
     )
 
   end
diff --git a/app/models/color_scheme.rb b/app/models/color_scheme.rb
index 434765b..526b2a0 100644
--- a/app/models/color_scheme.rb
+++ b/app/models/color_scheme.rb
@@ -4,6 +4,8 @@ require_dependency 'distributed_cache'
 
 class ColorScheme < ActiveRecord::Base
 
+  # rubocop:disable Layout/AlignHash
+
   CUSTOM_SCHEMES = {
     'Dark': {
       "primary" =>           'dddddd',
@@ -97,8 +99,11 @@ class ColorScheme < ActiveRecord::Base
     }
   }
 
+  # rubocop:enable Layout/AlignHash
+
   def self.base_color_scheme_colors
     base_with_hash = {}
+
     base_colors.each do |name, color|
       base_with_hash[name] = "#{color}"
     end
@@ -110,6 +115,7 @@ class ColorScheme < ActiveRecord::Base
     CUSTOM_SCHEMES.each do |k, v|
       list.push(id: k.to_s, colors: v)
     end
+
     list
   end
 
@@ -208,6 +214,7 @@ class ColorScheme < ActiveRecord::Base
   def colors_by_name
     @colors_by_name ||= self.colors.inject({}) { |sum, c| sum[c.name] = c; sum; }
   end
+
   def clear_colors_cache
     @colors_by_name = nil
   end
diff --git a/app/models/post_action.rb b/app/models/post_action.rb
index 8442b19..8efa750 100644
--- a/app/models/post_action.rb
+++ b/app/models/post_action.rb
@@ -435,12 +435,12 @@ class PostAction < ActiveRecord::Base
   before_create do
     post_action_type_ids = is_flag? ? PostActionType.notify_flag_types.values : post_action_type_id
     raise AlreadyActed if PostAction.where(user_id: user_id)
-        .where(post_id: post_id)
-        .where(post_action_type_id: post_action_type_ids)
-        .where(deleted_at: nil)
-        .where(disagreed_at: nil)
-        .where(targets_topic: targets_topic)
-        .exists?
+      .where(post_id: post_id)
+      .where(post_action_type

GitHub

1 Like