-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
--config
as a global flag/env var
#9892
Comments
Also noticed that some global flags (like
so it looks like it is trying to run |
I think this might be solved in the next release via #9599, which lets you pass any argument via the Separately... the |
Unless I have missed something, I do not think so. We need a way to wrap the ruff binary such that we can always pass the |
Can I ask what subcommands you're running? |
All of them. I.e. we expose a wrapped ruff executable so that users can use like it was the original ruff, only with our default config. Alas, they might run |
I quite like pytest's solution to this problem — they allow arbitrary CLI options to be set using the |
My main concern with fancy environment option inheritance is that it can feel rather magic and is hard to debug. I've run into this more than once myself where I forgot that I set some env variable and couldn't figure out why a tool isn't behaving the way I expect it. This can be mitigated by providing better debugging tools explaining from where ruff takes which options but this is something I haven't seen in any tool today. |
In our case it does not have to be environment either. But the other tools we use ( |
Making --config a global option makes sense to me |
This was really confusing until I found this issue. Simply reporting the name of the file not found as part of the error message would have helped pin things down. |
Hi,
Thanks for a great tool! However, it would be super great if the
--config
flag could be passed globally. I.e. that all commands accepted it but did not use it. We are generating the ruff config and wrapping the tool execution in a script and currently we have to parse the subcommand to know when to add--config
or not. An environment variable to control the config file would also work fine.The text was updated successfully, but these errors were encountered: