Add missing tool.ruff in configuration documentation.#2643
Add missing tool.ruff in configuration documentation.#2643Chris-May wants to merge 1 commit intoastral-sh:mainfrom
tool.ruff in configuration documentation.#2643Conversation
|
Confusingly, this is actually correct, because that section is talking about If you scroll up in the docs, you'll see that we do include the [tool.ruff]
# Enable flake8-bugbear (`B`) rules.
select = ["E", "F", "B"]
# Never enforce `E501` (line length violations).
ignore = ["E501"]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[tool.ruff.per-file-ignores]
"__init__.py" = ["E402"]
"path/to/file.py" = ["E402"]I'll try to make this clearer. I'm really sorry that you lost time to it. |
|
Ah! Thanks for the clarity!!! I remember reading about the Would you want to make that more explicit? I can think of two options:
As an alternative to pyproject.toml, Ruff will also respect a ruff.toml file, which implements an equivalent schema (though the [tool.ruff] hierarchy can be omitted). For example, the pyproject.toml described above would be represented via the following ruff.toml: Additionally, the intro paragraph to the section mentions that there are two ways to configure If you're open to it, I'd be happy to update this PR with an option. Otherwise, I can happily let you focus on more pressing topics. 😃 |
|
That'd be great! I'd be happy with Option 1 (and adding |
This completes the word from the discussion in #2643, adding headers to clarify the `pyproject.toml` and `ruff.toml` sections.
The documentation includes a configuration example that shows one can configure ruff's per-file ignore patterns by adding the following section to
pyproject.toml:It should be
[tool.ruff.per-file-ignores]This one caused me a few hours of issues, so I decided to contribute a fix.