Skip to content

Fix ruff errors and make the ruff step fail the Lint job - #41

Merged
eliotwrobson merged 3 commits into
mainfrom
claude/ruff-required
Nov 11, 2026
Merged

eliotwrobson merged 3 commits into
mainfrom
claude/ruff-required

Conversation

@eliotwrobson

Copy link
Copy Markdown
Collaborator

The Lint job ran ruff with continue-on-error, so the 131 errors on main never failed it. This fixes them and removes continue-on-error.

  • Scenario fixtures: files under tests/scenario_root/ stand in for student code. They use names the sandbox injects, import inside functions to test import restrictions, and evaluate bare expressions, so F821, PLC0415 and B018 are ignored there. That covers most of the errors.
  • Excluded: the three files that test syntax-error handling, since they can't be parsed, and the fixture notebooks, since ruff format rewrites a #grade cell tag as # grade.
  • json_utils.py: PLC0415 is ignored, because numpy and pandas aren't in the lite image.
  • Everything else is fixed in code: a from None on a re-raise, split compound asserts, zip(strict=True), an isinstance check, import order, and noqa on the intentional exec and dill.loads. ruff format also joined one line in config.py.
  • Removed PT004 from the ignore list, because ruff no longer has that rule.

There's no branch protection on main, so the Lint job isn't a required check yet. That has to be set in the repository settings.

🤖 Generated with Claude Code

@eliotwrobson
eliotwrobson marked this pull request as ready for review November 11, 2026 06:03
@eliotwrobson
eliotwrobson merged commit 5e0dcbc into main Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant