Skip to content

Commit

Permalink
DEV: Fix new Rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
Flink committed Feb 22, 2024
1 parent ae26c05 commit 6c368a0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 23 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
source "https://rubygems.org"

group :development do
gem "rubocop-discourse"
gem "rubocop-discourse",
require: false,
github: "discourse/rubocop-discourse",
branch: "loic-plugins-rules"
gem "syntax_tree"
end
46 changes: 38 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,53 @@
GIT
remote: https://github.com/discourse/rubocop-discourse.git
revision: dde0c0720b088e82398bc25dd3a8a31dab4bbc29
branch: loic-plugins-rules
specs:
rubocop-discourse (3.6.0)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-rspec (>= 2.25.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.6)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.0)
ruby2_keywords
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.22.2)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.0.3)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.7.3)
rainbow (3.1.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.59.0)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand All @@ -28,26 +58,26 @@ GEM
parser (>= 3.2.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.6.0)
rubocop (>= 1.59.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)

PLATFORMS
ruby

DEPENDENCIES
rubocop-discourse
rubocop-discourse!
syntax_tree

BUNDLED WITH
2.5.4
2.5.3
6 changes: 3 additions & 3 deletions lib/discourse_assign/list_controller_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

module DiscourseAssign
module ListControllerExtension
def self.prepended(base)
base.class_eval { ListController.generate_message_route(:private_messages_assigned) }
end
extend ActiveSupport::Concern

prepended { generate_message_route(:private_messages_assigned) }
end
end
6 changes: 3 additions & 3 deletions lib/discourse_assign/post_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

module DiscourseAssign
module PostExtension
def self.prepended(base)
base.class_eval { has_one :assignment, as: :target, dependent: :destroy }
end
extend ActiveSupport::Concern

prepended { has_one :assignment, as: :target, dependent: :destroy }
end
end
6 changes: 3 additions & 3 deletions lib/discourse_assign/topic_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

module DiscourseAssign
module TopicExtension
def self.prepended(base)
base.class_eval { has_one :assignment, as: :target, dependent: :destroy }
end
extend ActiveSupport::Concern

prepended { has_one :assignment, as: :target, dependent: :destroy }
end
end
13 changes: 8 additions & 5 deletions lib/discourse_assign/web_hook_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

module DiscourseAssign
module WebHookExtension
def self.prepended(base)
base.class_eval do
def self.enqueue_assign_hooks(event, payload)
WebHook.enqueue_hooks(:assign, event, payload: payload) if active_web_hooks(event).exists?
end
extend ActiveSupport::Concern

prepended {}

class_methods do
def enqueue_assign_hooks(event, payload)
return unless active_web_hooks(event).exists?
enqueue_hooks(:assign, event, payload: payload)
end
end
end
Expand Down

0 comments on commit 6c368a0

Please sign in to comment.