Skip to content

Commit

Permalink
Fix Lint/SendWithMixinArgument cop
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Jan 31, 2024
1 parent 07ee874 commit 1639598
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ Lint/ScriptPermission:
- 'examples/memory_limit_watcher.rb'
- 'examples/sub_plan_concurrency_control.rb'

# Offense count: 4
# Cop supports --auto-correct.
Lint/SendWithMixinArgument:
Exclude:
- 'lib/dynflow.rb'
- 'lib/dynflow/debug/telemetry/persistence.rb'
- 'test/activejob_adapter_test.rb'
- 'test/executor_test.rb'

# Offense count: 3
Lint/ShadowingOuterLocalVariable:
Exclude:
Expand Down
5 changes: 1 addition & 4 deletions lib/dynflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def self.from_hash(hash)

class Railtie < ::Rails::Railtie
config.before_initialize do
::ActiveJob::QueueAdapters.send(
:include,
Dynflow::ActiveJob::QueueAdapters
)
::ActiveJob::QueueAdapters.include Dynflow::ActiveJob::QueueAdapters
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/dynflow/debug/telemetry/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ module Persistence
end
end

::Dynflow::Persistence.send(:prepend, ::Dynflow::Debug::Persistence)
::Dynflow::Persistence.prepend ::Dynflow::Debug::Persistence
2 changes: 1 addition & 1 deletion test/activejob_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def perform(msg)
end

before(:all) do
::ActiveJob::QueueAdapters.send(:include, ::Dynflow::ActiveJob::QueueAdapters)
::ActiveJob::QueueAdapters.include ::Dynflow::ActiveJob::QueueAdapters
::ActiveJob::Base.queue_adapter = :dynflow
dynflow_mock = Minitest::Mock.new
dynflow_mock.expect(:world, world)
Expand Down
2 changes: 1 addition & 1 deletion test/executor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def wait_for_orchestrator_lock; end
def reacquire_orchestrator_lock; end
end

::Dynflow::Executors::Sidekiq::Core.send(:prepend, RedisMocks)
::Dynflow::Executors::Sidekiq::Core.prepend RedisMocks

module Dynflow
module ExecutorTest
Expand Down

0 comments on commit 1639598

Please sign in to comment.