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

Do not accept abbreviated options for cli #12282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fatkodima
Copy link
Contributor

Fixes #12280.

Was also surprised that rubocop's cli accepts abbreviated options. I do not think this is a convenience, but more like a bug if you do not specify the correct option.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 14, 2023

Today I learned. 😆 I agree that's more of a bug, as I never meant for this to be the actual behavior.

@koic
Copy link
Member

koic commented Oct 14, 2023

Um, this change could potentially be a breaking change for some users. Whether the shorthand name is appropriate or not may be a matter of perspective.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 14, 2023

Um, this change could potentially be a breaking change for some users. Whether the shorthand name is appropriate or not may be a matter of perspective.

I also thought of this, but I can't think of a single time I've seen someone use those shorthand options (in any application), so I don't think that's a big deal. Normally they are useful for commands that don't have a shorthand in the first place, but I think it RuboCop pretty much every command has an explicit shorthand.

@@ -0,0 +1 @@
* [#12280](https://github.com/rubocop/rubocop/issues/12280): Do not accept abbreviated options for cli. ([@fatkodima][])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [#12280](https://github.com/rubocop/rubocop/issues/12280): Do not accept abbreviated options for cli. ([@fatkodima][])
* [#12280](https://github.com/rubocop/rubocop/issues/12280): **(Breaking)** Do not accept abbreviated options for cli. ([@fatkodima][])

If this change is made, it seems prudent to explicitly note **(Breaking)** in the changelog entry.

@bbatsov
Copy link
Collaborator

bbatsov commented Oct 14, 2023

We can also simply bucket this to the list of breaking changes liked up for a potential RuboCop 2.0 down the road.

@koic
Copy link
Member

koic commented Oct 14, 2023

Ah, might be overthinking on my part. Releasing it without waiting for RuboCop 2.0 could probably be tried. (e.g. next minor release)

@fatkodima
Copy link
Contributor Author

Agreed with both of you. Do not think anyone uses it.

CI is broken, because seems like I have found a bug in optionparser - it does not handle options specified with
--[no-]something with require_exact = true. Will investigate more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option --disable-pending-cops is activated with as little as --disable-p
3 participants