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

Also fixes whitespace related issues raised by rubocop.
This commit is contained in:
Jarek Radosz 2020-10-30 15:04:29 +01:00 committed by GitHub
parent af4938baf1
commit 2f4a1ff61b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 20 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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}
)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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">

View File

@ -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)
AND EXISTS (SELECT 1 FROM jforum_users u WHERE k.from_user_id = u.user_id)
ORDER BY k.post_id, k.from_user_id
LIMIT #{BATCH_SIZE}
SQL