Description
Hi there!
I'm having some problems that maybe someone could help with 😘
We're trying to create some unification around linting and formatting at work and what we've landed in is using a repo as a submodule which contains a pre-commit config and shared formatter and linting rules. This actually works better than expected.
But, I'm having some issues with Ruff configuration, because I would like to provide basic rules in the submodule while also letting the user configure rules with their own config.
So my idea was that in a repo structure like this
common-build/ (submodule)
--->.pre-commit-config.yml
--->.ruff.toml
src/
README.md
(had a hard time with indentation on mobile 😉 the config files are inside the submodule folder)
The user would get the .ruff.toml settings if they have no other settings file when they invoke pre-commit run --all-files -c common-build/.pre-commit-config.yml
But if they wanted to, they could put a pyproject.toml or other config in the root and use the extend
setting in that file to reference the config in the submodule. And this would then use both the setting files.
However when I run from the root with only the config in the submodule and no settings in the root, it seems Ruff does not find and use the config inside the submodule 🤔 I thought it would try and find a config wherever it was in the repo. When I explicitly call it with --config it works.
Am I doing something wrong here, or am I doing something that cannot be done or is there any pre-commit gimmick that ruins my way of thinking?
Cheers
Carl