Skip to content

ci: add automated style linting (ruff) so style issues are caught before review #124

Description

@Huoyanlifusu

Problem

Style rules are currently enforced by hand during review. For example, #121 was asked to re-wrap lines to 80 chars and add the file-location comment (# checks/async/async7.py) after the fact — things a linter could catch before a maintainer spends time on the PR.

Current state

  • No ruff/black/flake8/isort config, no .editorconfig, no .pre-commit-config.yaml.
  • pyproject.toml has no [tool.ruff] section.
  • CI (ci.yml) runs pytest, the passing-curriculum verify, and python -m build — but no lint step.

Proposal

Add ruff as the single linter and formatter, configured for the repo's existing Google-Python-style / 80-character convention:

  • [tool.ruff] with line-length = 80
  • ruff check and ruff format --check as a CI job
  • ruff added to the dev dependency group
  • optionally a .pre-commit-config.yaml for local hooks

Questions for maintainer

  • OK to standardize on ruff (instead of flake8 + black)?
  • Should the # checks/<topic>/<file>.py file-location comment also get an automated check, or just be documented in CONTRIBUTING.md?

Acceptance criteria

  • Lint/format runs in CI and fails the build on style violations.
  • Config matches the documented 80-char / Google Python style.
  • CONTRIBUTING.md explains how to run lint locally.

Metadata

Metadata

Assignees

Labels

area: coreCore workspace, manifest, state, and runner behaviordocumentationImprovements or additions to documentationsize: MMedium, self-contained contribution

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions