We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The IgnoredSkipActionFilterOption fails to catch a problem when skip_before_action is given multiple names (positional arguments).
IgnoredSkipActionFilterOption
skip_before_action
Both of these should be considered "bad" by IgnoredSkipActionFilterOption.
skip_before_action :arg1, only: :show, if: :trusted_login?
skip_before_action :arg1, :arg2, only: :show, if: :trusted_login?
Make sure that Rails/IgnoredSkipActionFilterOption is enabled on all files.
Write a file in things_controller.rb as follows:
things_controller.rb
class ThingsController < ApplicationController skip_before_action :arg1, :arg2, only: :show, if: :trusted_login? end
Run rubocop: it will not find an issue.
Remove , :arg2
, :arg2
Run rubocop: it will find an issue.
❯ bin/rubocop -V 1.59.0 (using Parser 3.3.0.4, rubocop-ast 1.30.0, running on ruby 3.2.2) [arm64-darwin22] - rubocop-minitest 0.34.4 - rubocop-performance 1.20.2 - rubocop-rails 2.23.1 - rubocop-rake 0.6.0 - rubocop-thread_safety 0.5.1
The text was updated successfully, but these errors were encountered:
Rails/IgnoredSkipActionFilterOption
Successfully merging a pull request may close this issue.
The
IgnoredSkipActionFilterOption
fails to catch a problem whenskip_before_action
is given multiple names (positional arguments).Expected behavior
Both of these should be considered "bad" by IgnoredSkipActionFilterOption.
skip_before_action :arg1, only: :show, if: :trusted_login?
skip_before_action :arg1, :arg2, only: :show, if: :trusted_login?
Actual behavior
Steps to reproduce the problem
Make sure that Rails/IgnoredSkipActionFilterOption is enabled on all files.
Write a file in
things_controller.rb
as follows:Run rubocop: it will not find an issue.
Remove
, :arg2
Run rubocop: it will find an issue.
RuboCop version
The text was updated successfully, but these errors were encountered: