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

(🎁) Ability to specify default files in the config #3970

Closed
KotlinIsland opened this issue Apr 14, 2023 · 4 comments · Fixed by #8791
Closed

(🎁) Ability to specify default files in the config #3970

KotlinIsland opened this issue Apr 14, 2023 · 4 comments · Fixed by #8791
Labels
configuration Related to settings and configuration

Comments

@KotlinIsland
Copy link
Contributor

I want to be able to specify the default files within the configuration file so that I don't need to duplicate this config in different places.

[tool.ruff]
files = ["src", "scripts"]

Then it is possible to invoke ruff without passing any paths:

👉 ruff
yada yada yada
@charliermarsh charliermarsh added the configuration Related to settings and configuration label Apr 14, 2023
@charliermarsh
Copy link
Member

I think this is pretty reasonable, Black supports this too and it's useful. @MichaReiser - any thoughts here?

@KotlinIsland
Copy link
Contributor Author

@charliermarsh How do you do it in Black? I can't find it anywhere...

@charliermarsh
Copy link
Member

I was mixed up -- Black doesn't support this, but Mypy does.

@JSchoeck
Copy link

JSchoeck commented Jun 5, 2023

[Edit]
I think what I wanted is already possible, I just did't get it when I read it the first time, see the docs
For Windows, the $(config_dir) is equivalent to: %userprofile%\AppData\Roaming
So putting a a pyproject.toml into %userprofile%\AppData\Roaming\ruff should set a global default and I confirm it works on my PC.


Do I understand the described use case correctly, that it should be possible to declare a pyproject.toml file as the global default, which overrides the built-in ruff default settings (but does not override project-specific pyproject.toml files)?

In that case, I agree very much that this feature is very helpful, even needed.

PS: Thanks for your development efforts, ruff is great!

zanieb added a commit that referenced this issue Nov 21, 2023
…tory (#8791)

Closes #7347
Closes #3970 via use of `include`

We could update examples in our documentation, but I worry since we do
not have versioned documentation users on older versions would be
confused. Instead, I'll open an issue to track updating use of `ruff
check .` in the documentation sometime in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants