Skip to content

RUF200 cannot be ignored via per-file-ignores when TOML parse fails early #24305

@enricostragiotti

Description

@enricostragiotti

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

  1. Create a TOML file matching the ignore glob (release/*.toml).
  2. Put an intentionally invalid version placeholder in dependencies, for example:
    • "some-package>=VERSION_PLACEHOLDER"
  3. Configure Ruff with per-file-ignore for RUF200 on release/*.toml.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for support or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions