Skip to content

ci: lint docs/assets/scripts in make lint and CI#53

Merged
Chouffe merged 2 commits into
mainfrom
arthur/lint-docs-scripts
Jun 12, 2026
Merged

ci: lint docs/assets/scripts in make lint and CI#53
Chouffe merged 2 commits into
mainfrom
arthur/lint-docs-scripts

Conversation

@Chouffe

@Chouffe Chouffe commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a root-level ruff.toml as the authoritative ruff config for scripts outside the packages, mirroring the identical [tool.ruff] config every package already declares
  • Hook docs/assets/scripts/ into the root make lint / make format targets, running ruff via core's venv
  • Add a docs-scripts CI job running ruff check + ruff format --check on the scripts, with a lightweight uv sync --only-group dev of core (no torch install)

Closes #43

Test Plan

  • make lint passes end-to-end, including the new docs/assets/scripts step
  • Canary file with unsorted imports is flagged (I001), proving the root ruff.toml is discovered — the isort rule is not in ruff's defaults
  • Package linting unaffected (per-package pyproject.toml config is closer and wins)
  • Exact CI command sequence verified locally (uv sync --only-group dev + uv run --project core --no-sync ruff ...)
  • core test suite passes (250 tests)

The figure generator scripts added in #42 were ruff-clean but nothing
enforced it. Add a root-level ruff.toml as the authoritative config for
scripts outside the packages (mirroring the shared per-package config),
hook docs/assets/scripts into the root lint/format targets via core's
venv, and add a docs-scripts CI job that runs ruff check + format
--check with a dev-only sync of core.

Closes #43
@Chouffe Chouffe requested a review from MateoLostanlen June 11, 2026 16:23
@MateoLostanlen

Copy link
Copy Markdown
Member

LGTM. Verified the mechanics hold: ruff is in core's dev group so the torch-free uv sync --only-group dev + --no-sync ruff works, and with no root pyproject.toml the new ruff.toml is discovered for docs/assets/scripts while per-package configs stay closer and win. CI follows existing conventions and the I001 canary is a nice proof.

Two non-blocking notes:

  • Config is now duplicated 6× (5 packages + root), enforced only by the "keep in sync" comment. Worth a follow-up to centralize via ruff's extend.
  • make lint/format omit the --no-sync that CI uses, so a local run can trigger a full core sync (torch). Minor asymmetry, fine as-is.

@Chouffe Chouffe merged commit 8830037 into main Jun 12, 2026
6 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.

Lint docs/assets/scripts in make lint / CI

2 participants