Replies: 1 comment 4 replies
-
Hi @nurpax Yeah, I don't think your use case is supported today. There's a related issue #12352 but what you want goes beyond that because it doesn't cover the Without the csae of
I can see how this would solve the problem for |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'd like to maintain a shared "default settings" ruff.toml among my team mates at work. We'd like to keep this file in a common git repository. In addition to setting the default warning enable/disables, we'd like to optionally extend from this shared ruff.toml file in some of our sub directories.
I could implement this with hardcoded paths:
However, I'm drawing blanks on how to implement this more flexibly.
For example, we'd keep
~/.config/ruff/ruff.toml
in revision control and not under~/.config/ruff
. So ruff by default won't find it there. On Linux we could potentially symlink it, but Windows users are pretty seriously averse to using symlinks. Even still, how would the pyproject.toml extend line refer to this file in a platform independent way as~/.config/ruff
path is not necessarily the same across Linux, Windows and macOS.We could move the shared config somewhere else and refer to it indirectly using an environment variable. With this, the pyproject.toml extend line could use something like
extend=$RUFF_CONFIG_FILE
. The problem is then that subdirectories without pyproject.toml won't pick up the shared config file unless invoke ruff withruff check --config=$RUFF_CONFIG_FILE
. I would very much likeruff check
to suffice in every part of our codebase without users needing to memorize additional options or having to configure other tools like VSCode to also specify this.One satisfying solution would be if ruff allowed giving the
--config
argument via an environment variable. For example, if$RUFF_CONFIG_FILE
is set, ruff would load its default config from that path. I tried to dig through docs and source, but it looks like there's no support for passing this through the environment?Any alternative ways to express this "shared settings, but overridden in some subdirs" desire?
Beta Was this translation helpful? Give feedback.
All reactions