Skip to content

lint: what do we do with the checks/ directory once Ruff is required? #133

Description

@Huoyanlifusu

Problem

checks/ currently reports ~1374 violations under Ruff, but 1162 of them are F821 (undefined-name) — which is just how the checks work: they reference names the learner hasn't defined yet, and the runner's shared-namespace mechanism resolves them at runtime. So that count is mostly noise.

The rest is roughly 212 real-ish ones:

  • 159 × E501 (long lines)
  • 18 × E712 (comparing with == True etc.)
  • 13 × E402 (imports not at top)
  • 11 × I001 (unsorted imports)
  • ~11 others

But these files are part of the curriculum: they're mirrored with exercises/ and solutions/ and get copied into learner workspaces. I don't want to reformat them blindly and end up with noisy diffs or confusing changes for learners.

Proposed Behavior

Before doing anything, I'd like to agree on the policy. My suggestion:

  1. Per-file-ignore F821 for checks/** (it's expected, not a bug):
[tool.ruff.lint.per-file-ignores]
"checks/**/*.py" = ["F821"]
  1. Leave the remaining ~212 alone for now and decide later whether they're worth fixing (probably yes, but as its own pass, keeping the exercise/check/solution mirrors in sync).

Alternatives Considered

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions