-
Notifications
You must be signed in to change notification settings - Fork 2k
RUF200 cannot be ignored via per-file-ignores when TOML parse fails early #24305
Description
Summary
I am trying to ignore RUF200 for release template TOML files, but Ruff still fails before the ignore rule is applied.
In my project, release/pyproject.toml intentionally contains placeholders such as VERSION_PLACEHOLDER that are replaced during release packaging. I want Ruff to skip RUF200 on that file.
Ruff version
- ruff 0.15.8
Configuration
[lint.per-file-ignores]
"release/*.toml" = [
"RUF200", # release template contains VERSION_PLACEHOLDER
]Reproduction
- Create a TOML file matching the ignore glob (
release/*.toml). - Put an intentionally invalid version placeholder in dependencies, for example:
"some-package>=VERSION_PLACEHOLDER"
- Configure Ruff with per-file-ignore for
RUF200onrelease/*.toml. - Run:
ruff check
Actual behavior
Ruff fails with RUF200 parse error anyway:
RUF200 Failed to parse pyproject.toml: expected version to start with a number, but no leading ASCII digits were found
...
--> release\pyproject.toml:24:16
...
"fast-oad-core>=VERSION_PLACEHOLDER"
Expected behavior
If a file is matched by per-file-ignores for RUF200, Ruff should not fail the run for RUF200 on that file.
If this is not intended, it would help to document that RUF200 parse-time failures happen before per-file-ignores are applied.
Release-template files with placeholders are common in CI/release flows. Being unable to suppress RUF200 per-file makes it hard to keep strict linting while preserving release templates in-repo.
Version
ruff 0.15.8