Skip to content

linter check misses Ruff configured in pyproject.toml #9

Description

@stichbury

Just to say, I am a real person, but I used Claude to generate this issue copy, so it'll look like it's AI generated...because it is 😄

Summary

The linter criterion detects Ruff only when it's configured via a
standalone .ruff.toml / ruff.toml. Projects that configure Ruff
inside pyproject.toml (the recommended layout for most Python
projects) are reported as having no linter. There's some inconsistency as the sibling
formatter check does inspect pyproject.toml for [tool.ruff.

Reproduction

tmp=$(mktemp -d)
cat > "$tmp/pyproject.toml" <<'EOF'
[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
EOF
bun run src/index.ts "$tmp" --ci --no-web | grep -Ei 'linter|formatter'

Result on the same file:

  • [-] No linter configuration found.
  • [+] Python formatter configuration found in pyproject.toml

Root cause

Suggested fix

Add the same pyproject.toml inspection to the linter detector, right after the existing .ruff.toml file check:

const pyproject = await readFileContent(repoPath, "pyproject.toml");
if (pyproject && pyproject.includes("[tool.ruff")) {
  return {
    criterionId: "linter",
    pass: true,
    message: "Ruff linter configuration found in pyproject.toml",
  };
}

Ruff enables check by default whenever [tool.ruff] is present, so matching the prefix (which covers [tool.ruff], [tool.ruff.lint], and lint sub-tables) is consistent with the formatter check's logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions