Skip to content

Commit

Permalink
DEV: Update rubocop-discourse to version 3.8.0 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flink authored May 28, 2024
1 parent 54c7d6a commit dd8cbd5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
17 changes: 12 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ GEM
concurrent-ruby (~> 1.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
minitest (5.23.0)
minitest (5.23.1)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.7.3)
racc (1.8.0)
rack (3.0.11)
rainbow (3.1.1)
regexp_parser (2.9.2)
rexml (3.2.8)
strscan (>= 3.0.9)
rubocop (1.63.5)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -48,14 +49,20 @@ GEM
parser (>= 3.3.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.7.1)
rubocop-discourse (3.8.0)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
rubocop-factory_bot (>= 2.0.0)
rubocop-rails (>= 2.25.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.25.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
Expand All @@ -79,4 +86,4 @@ DEPENDENCIES
syntax_tree

BUNDLED WITH
2.5.4
2.5.10
4 changes: 2 additions & 2 deletions jobs/flag_toxic_post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
module Jobs
class FlagToxicPost < ::Jobs::Base
def execute(args)
raise Discourse::InvalidParameters.new(:post_id) unless args[:post_id].present?
raise Discourse::InvalidParameters.new(:post_id) if args[:post_id].blank?

unless SiteSetting.perspective_enabled? &&
SiteSetting.perspective_flag_post_min_toxicity_enable?
return
end

post = Post.where(id: args[:post_id]).first
return unless post.present? && !post.trashed?
return if post.blank? || post.trashed?

DiscoursePerspective.check_post_toxicity(post)
end
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "discourse-perspective-api",
"private": true,
"devDependencies": {
"@discourse/lint-configs": "^1.3.5",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"prettier": "^2.8.8"
"@discourse/lint-configs": "1.3.9",
"ember-template-lint": "6.0.0",
"eslint": "8.57.0",
"prettier": "2.8.8"
}
}
2 changes: 1 addition & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def post_toxicity
private

def check_content(content)
content&.present? && DiscoursePerspective.check_content_toxicity(content, current_user)
content.present? && DiscoursePerspective.check_content_toxicity(content, current_user)
end
end

Expand Down

0 comments on commit dd8cbd5

Please sign in to comment.