You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like a way to activate a rule for a subset of files; basically the inverse of per-file-ignores. In my case, I'd like to activate pydocstyle on the main module, but not tests, examples, docs, benchmarks, support files, setup.py, etc.
Current and possible options:
Use a second ruff.toml/pyproject.toml inside the package. This is not ideal, as I don't want to add extra files (especially pyproject.toml's, as those should only be at the root of packages). This is the only one in the list that would work today (that I know of). .ruff.toml (Additional configuration file .ruff.toml #2988) would help a little, but still not my preferred solution for this case - I'd like all configuration in a single file.
Add tool.ruff.per-file-extend-select (technically, per-file-ignores is also extend, so maybe for symmetry it could be tool.ruff.per-file-extend-select). This would then be "src/**.py" = ["D"].
Support negation in tool.ruff.per-file-ignores like a gitignore. So "!src/**.py" = ["D"] would ignore D on anything except src/**.py files.
I'd like a way to activate a rule for a subset of files; basically the inverse of per-file-ignores. In my case, I'd like to activate pydocstyle on the main module, but not tests, examples, docs, benchmarks, support files, setup.py, etc.
Current and possible options:
.ruff.toml(Additional configuration file.ruff.toml#2988) would help a little, but still not my preferred solution for this case - I'd like all configuration in a single file.tool.ruff.per-file-extend-select(technically,per-file-ignoresis also extend, so maybe for symmetry it could betool.ruff.per-file-extend-select). This would then be"src/**.py" = ["D"].tool.ruff.per-file-ignoreslike a gitignore. So"!src/**.py" = ["D"]would ignore D on anything exceptsrc/**.pyfiles.Thoughts?
Here's what I would have to put without this: