DEV: Update rubocop-discourse from 2.3.2 to 2.4.0 (#11079)

DEV: Update rubocop-discourse from 2.3.2 to 2.4.0 (#11079)

Also fixes whitespace related issues raised by rubocop.

diff --git a/Gemfile.lock b/Gemfile.lock
index 1e557f2..8e02d7c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -340,23 +340,22 @@ GEM
       json-schema (~> 2.2)
       railties (>= 3.1, < 7.0)
     rtlit (0.0.5)
-    rubocop (0.93.1)
+    rubocop (1.1.0)
       parallel (~> 1.10)
       parser (>= 2.7.1.5)
       rainbow (>= 2.2.2, < 4.0)
       regexp_parser (>= 1.8)
       rexml
-      rubocop-ast (>= 0.6.0)
+      rubocop-ast (>= 1.0.1)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 2.0)
     rubocop-ast (1.1.0)
       parser (>= 2.7.1.5)
-    rubocop-discourse (2.3.2)
-      rubocop (>= 0.69.0)
-      rubocop-rspec (>= 1.39.0)
-    rubocop-rspec (1.44.1)
-      rubocop (~> 0.87)
-      rubocop-ast (>= 0.7.1)
+    rubocop-discourse (2.4.0)
+      rubocop (>= 1.1.0)
+      rubocop-rspec (>= 2.0.0.pre)
+    rubocop-rspec (2.0.0.pre)
+      rubocop (~> 1.0)
     ruby-prof (1.4.1)
     ruby-progressbar (1.10.1)
     ruby-readability (0.7.0)
diff --git a/app/models/concerns/reports/moderators_activity.rb b/app/models/concerns/reports/moderators_activity.rb
index fc3f77c..135e4f0 100644
--- a/app/models/concerns/reports/moderators_activity.rb
+++ b/app/models/concerns/reports/moderators_activity.rb
@@ -152,7 +152,7 @@ module Reports::ModeratorsActivity
       AND p.created_at <= '#{report.end_date}'
       GROUP BY p.user_id
       )
-    
+
       SELECT
       m.user_id,
       m.username,
diff --git a/app/models/concerns/reports/top_ignored_users.rb b/app/models/concerns/reports/top_ignored_users.rb
index ce1f08e..3b02f08 100644
--- a/app/models/concerns/reports/top_ignored_users.rb
+++ b/app/models/concerns/reports/top_ignored_users.rb
@@ -56,7 +56,7 @@ module Reports::TopIgnoredUsers
             ORDER BY COUNT(*) DESC
             LIMIT :limit
           )
-    
+
           SELECT u.id as user_id,
                  u.username as username,
                  u.uploaded_avatar_id as uploaded_avatar_id,
diff --git a/db/migrate/20200311135425_clear_approved_users_from_the_review_queue.rb b/db/migrate/20200311135425_clear_approved_users_from_the_review_queue.rb
index d26e4ac..349fea7 100644
--- a/db/migrate/20200311135425_clear_approved_users_from_the_review_queue.rb
+++ b/db/migrate/20200311135425_clear_approved_users_from_the_review_queue.rb
@@ -5,7 +5,7 @@ class ClearApprovedUsersFromTheReviewQueue < ActiveRecord::Migration[6.0]
       UPDATE reviewables r
       SET status = #{Reviewable.statuses[:approved]}
       FROM users u
-      WHERE u.id = r.target_id AND u.approved = true 
+      WHERE u.id = r.target_id AND u.approved = true
       AND r.type = 'ReviewableUser' AND r.status = #{Reviewable.statuses[:pending]}
       RETURNING r.id
     SQL
diff --git a/db/migrate/20200601130900_correct_schema_discrepancies.rb b/db/migrate/20200601130900_correct_schema_discrepancies.rb
index ad18fed..4d76e95 100644
--- a/db/migrate/20200601130900_correct_schema_discrepancies.rb
+++ b/db/migrate/20200601130900_correct_schema_discrepancies.rb
@@ -163,8 +163,8 @@ class CorrectSchemaDiscrepancies < ActiveRecord::Migration[6.0]
 
     raw_info = DB.query_hash <<~SQL
       SELECT table_name, column_name, is_nullable, character_maximum_length, column_default
-      FROM information_schema.columns 
-      WHERE table_schema='public' 
+      FROM information_schema.columns
+      WHERE table_schema='public'
       AND (
         #{lookup_sql}
       )
diff --git a/db/migrate/20200710013237_fix_topic_users_bookmarked_column_that_should_be_false.rb b/db/migrate/20200710013237_fix_topic_users_bookmarked_column_that_should_be_false.rb
index e84cdc5..a5fa7ae 100644
--- a/db/migrate/20200710013237_fix_topic_users_bookmarked_column_that_should_be_false.rb
+++ b/db/migrate/20200710013237_fix_topic_users_bookmarked_column_that_should_be_false.rb
@@ -7,7 +7,7 @@ class FixTopicUsersBookmarkedColumnThatShouldBeFalse < ActiveRecord::Migration[6
     UPDATE topic_users SET bookmarked = FALSE WHERE ID IN (
       SELECT DISTINCT topic_users.id FROM topic_users
       LEFT JOIN bookmarks ON bookmarks.topic_id = topic_users.topic_id AND bookmarks.user_id = topic_users.user_id
-      LEFT JOIN post_actions ON post_actions.user_id = topic_users.user_id AND post_actions.post_action_type_id = 1 AND post_actions.post_id IN (SELECT id FROM posts WHERE posts.topic_id = topic_users.topic_id) 
+      LEFT JOIN post_actions ON post_actions.user_id = topic_users.user_id AND post_actions.post_action_type_id = 1 AND post_actions.post_id IN (SELECT id FROM posts WHERE posts.topic_id = topic_users.topic_id)
       WHERE topic_users.bookmarked = true AND (bookmarks.id IS NULL AND post_actions.id IS NULL))
     SQL
     DB.exec(sql)
diff --git a/db/migrate/20200728022830_sync_topic_user_bookmarked_column_with_bookmarks.rb b/db/migrate/20200728022830_sync_topic_user_bookmarked_column_with_bookmarks.rb
index 76dfde6..3592616 100644
--- a/db/migrate/20200728022830_sync_topic_user_bookmarked_column_with_bookmarks.rb
+++ b/db/migrate/20200728022830_sync_topic_user_bookmarked_column_with_bookmarks.rb
@@ -18,7 +18,7 @@ class SyncTopicUserBookmarkedColumnWithBookmarks < ActiveRecord::Migration[6.0]
     UPDATE topic_users SET bookmarked = FALSE WHERE ID IN (
       SELECT DISTINCT topic_users.id FROM topic_users
       LEFT JOIN bookmarks ON bookmarks.topic_id = topic_users.topic_id AND bookmarks.user_id = topic_users.user_id
-      LEFT JOIN post_actions ON post_actions.user_id = topic_users.user_id AND post_actions.post_action_type_id = 1 AND post_actions.post_id IN (SELECT id FROM posts WHERE posts.topic_id = topic_users.topic_id) 
+      LEFT JOIN post_actions ON post_actions.user_id = topic_users.user_id AND post_actions.post_action_type_id = 1 AND post_actions.post_id IN (SELECT id FROM posts WHERE posts.topic_id = topic_users.topic_id)
       WHERE topic_users.bookmarked = true AND (bookmarks.id IS NULL AND post_actions.id IS NULL))
     SQL
     DB.exec(should_not_be_bookmarked_sql)
diff --git a/db/post_migrate/20200610150900_correct_posts_schema.rb b/db/post_migrate/20200610150900_correct_posts_schema.rb
index c2fc2ba..fe6acb9 100644
--- a/db/post_migrate/20200610150900_correct_posts_schema.rb
+++ b/db/post_migrate/20200610150900_correct_posts_schema.rb
@@ -9,10 +9,10 @@ class CorrectPostsSchema < ActiveRecord::Migration[6.0]
   # This should be done in a transaction
   def up
     result = DB.query <<~SQL
-      SELECT character_maximum_length 
-      FROM information_schema.columns 
+      SELECT character_maximum_length
+      FROM information_schema.columns
       WHERE table_schema='public'
-      AND table_name = 'posts' 
+      AND table_name = 'posts'
       AND column_name IN ('action_code', 'edit_reason')
     SQL
 
diff --git a/lib/twitter_api.rb b/lib/twitter_api.rb
index 7fe8ae6..5664bb2 100644
--- a/lib/twitter_api.rb
+++ b/lib/twitter_api.rb
@@ -54,7 +54,7 @@ class TwitterApi
                 <div class='tweet-images'>
                   <div class='aspect-image-full-size' style='--aspect-ratio:#{width}/#{height};'>
                     <video class='tweet-video' #{attributes}
-                      width='#{width}' 
+                      width='#{width}'
                       height='#{height}'
                       poster='#{m['media_url_https']}'>
                       <source src='#{url}' type="video/mp4">
diff --git a/script/import_scripts/jforum.rb b/script/import_scripts/jforum.rb
index 1f52412..e5d5671 100644
--- a/script/import_scripts/jforum.rb
+++ b/script/import_scripts/jforum.rb
@@ -398,7 +398,7 @@ class ImportScripts::JForum < ImportScripts::Base
         FROM jforum_karma k
         WHERE k.points >= 2 AND ((k.post_id = #{last_post_id} AND k.from_user_id > #{last_user_id}) OR k.post_id > #{last_post_id})
           AND EXISTS (SELECT 1 FROM jforum_posts p WHERE k.post_id = p.post_id)
-          AND EXISTS (SELECT 1 FROM jforum_users u WHERE k.from_user_id = u.user_id) 

[... diff too long, it was truncated ...]

GitHub sha: 2f4a1ff6

This commit appears in #11079 which was approved by pmusaraj. It was merged by CvX.