mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Add regular expression example for per-file-ignores
(#6573)
## Summary Hi! This is my first PR to `ruff` and thanks for this amazing project. While I am working on my project, I need to set different rules for my `test/` folder and the main `src` package. It's not immediately obvious that the [`tool.ruff.per-file-ignores`](https://beta.ruff.rs/docs/settings/#per-file-ignores) support regular expression. It is useful to set rules on directory level. The PR add a simple example to make it clear this support regex.
This commit is contained in:
parent
ebda5fcd99
commit
9a0d2f5afd
1 changed files with 1 additions and 0 deletions
|
@ -77,6 +77,7 @@ unfixable = ["B"]
|
|||
[tool.ruff.per-file-ignores]
|
||||
"__init__.py" = ["E402"]
|
||||
"path/to/file.py" = ["E402"]
|
||||
"**/{tests,docs,tools}/*" = ["E402"]
|
||||
```
|
||||
|
||||
Plugin configurations should be expressed as subsections, e.g.:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue