Skip to content
New issue

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

option --disable-pending-cops is activated with as little as --disable-p #12280

Open
matthewhively opened this issue Oct 13, 2023 · 0 comments · May be fixed by #12282
Open

option --disable-pending-cops is activated with as little as --disable-p #12280

matthewhively opened this issue Oct 13, 2023 · 0 comments · May be fixed by #12282

Comments

@matthewhively
Copy link

Expected behavior

rubocop --help lists command: --disable-pending-cops
And invoking rubocop with that option does what it says it does.

Actual behavior

rubocop --disable-p will also disable the pending cops.
rubocop --disable- or less will yield ambiguous option: --disable-

It looks like rubocop is using substring matches for all command line options?
Its kinda convenient to only type --disable-pending instead of the full option.
But this seems weird, I would assume any unrecognized options should throw an error, but I guess maybe this is intended and not a bug?

RuboCop version

rubocop -V
1.57.1 (using Parser 3.2.2.4, rubocop-ast 1.29.0, running on ruby 2.7.8) [x86_64-darwin21]
  - rubocop-performance 1.19.1
  - rubocop-rails 2.21.2
@fatkodima fatkodima linked a pull request Oct 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant