-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make --config
and --isolated
global flags
#10150
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvements that we could make that are unrelated to your change but could improve readability (as separate PRs):
- Rename
HelpFormat
toOutputFormat
. - Move
ConfigArguments
next toFormatArguments
andCheckArguments
.
Alright, ready for another look, I think 😅 the implementation now uses |
Summary
Fixes #9892.
This PR makes
--config
and--isolated
global flags that are accepted by all ruff subcommands: ruff will no longer error out if a redundant--config
argument is passed to a command such asruff version
orruff rule
. The flag has no effect for subcommands that do not need it (but it is still validated).Test Plan
There were no tests for
ruff version
, so I added them as part of this PR, and used the new tests to assert that the--config
flag is now accepted byruff version
. I also manually tested to check things were working as expected.