Commit a82b9a2
committed
ENH: Declare ruff's vendored-file excludes once in pyproject.toml
versioneer.py and monai/_version.py were excluded from ruff twice,
independently: .pre-commit-config.yaml's ruff hook via its own
"exclude:" regex, and runtests.sh via hardcoded --exclude flags on
the CLI invocation. Neither read from pyproject.toml, so a third
direct "ruff check" invocation (an editor, a one-off shell command)
would lint and offer to rewrite both files -- 200 violations today.
extend-exclude in [tool.ruff] gives runtests.sh's directory-walk
invocation (and any other caller that lets ruff discover its own
config) the same exclusion pre-commit's hook already applies, so the
CLI flags on the runtests.sh invocation are redundant and dropped.
Verified: 'ruff check' with pyproject.toml's new extend-exclude,
given the directory the way runtests.sh gives it, still reports
'All checks passed!' for the tree, and 'runtests.sh --ruff' is
unaffected end to end. Ruff ignores config exclude when handed
explicit filenames instead of a directory (the pre-commit hook path,
already governed by its own hook-level exclude, and not something
this PR touches).1 parent 303842d commit a82b9a2
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
| 602 | + | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| |||
0 commit comments