TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cj81499/advent-of-code/llms.txt
Use this file to discover all available pages before exploring further.
aoc-cj repository enforces a consistent quality bar through a layered stack of automated tools: Ruff handles Python formatting and linting, mypy provides strict static type checking, tombi keeps TOML files well-formatted and valid, pre-commit runs these tools locally before every commit, and GitHub Actions ties everything together in CI on every push and pull request.
Ruff
Ruff serves double duty as both the project’s formatter and linter. It is significantly faster than the tools it replaces (Black, isort, pyflakes, etc.) and is configured once inpyproject.toml.
Formatter
Ruff’s formatter enforces a consistent Python code style with a line length of 120 characters:pyproject.toml
Linter
The following rule sets are enabled:| Code | Rule set | Description |
|---|---|---|
F401 | Pyflakes (subset) | Flag unused imports |
W | pycodestyle warnings | Style warnings (e.g. whitespace issues) |
I | isort | Import ordering |
UP | pyupgrade | Modernise syntax for the target Python version |
ERA | eradicate | Detect commented-out code |
RUF | Ruff-specific | Ruff’s own opinionated rules |
mypy
mypy is configured in strict mode, meaning the full set of strictness flags is active. In addition to the built-in strict bundle, several extra error codes are enabled explicitly:pyproject.toml (selected settings)
Year exclusions
Solutions from 2017 through 2021 pre-date the project’s adoption of strict typing and are excluded from mypy’s analysis to avoid a large backlog of pre-existing errors:pyproject.toml
aocd override
aocd does not ship type stubs, so its imports are silenced with a targeted override rather than disabling checks globally:
pyproject.toml
Run mypy
tombi
tombi formats and lints TOML files (includingpyproject.toml itself) to keep them consistently styled and schema-valid.
GitHub Actions CI
Thepython-package.yaml workflow runs on every push to main, every pull request, and every merge queue entry. It is composed of three jobs.
build job
Runs on a matrix of Python 3.13 and Python 3.14 (ubuntu-latest). The steps execute in order:
| Step | Command |
|---|---|
| Sanity-check Python version | uv run --frozen python --version --version |
| Format check (Ruff) | uv run --frozen ruff format --check . |
| Format check (tombi) | uv run --frozen tombi format --check |
| Lint Python (Ruff) | uv run --frozen ruff check --output-format=github . |
| Lint TOML (tombi) | uv run --frozen tombi lint |
| Type check (mypy) | uv run --frozen mypy . |
| Run tests with coverage | uv run --frozen pytest --cov=. --cov-report=xml |
| Upload coverage | codecov/codecov-action → Codecov |
--frozen to ensure the lockfile is not modified during CI.
The workflow defaults to
permissions: contents: none at the top level and grants contents: read only to the build job, following the principle of least privilege.zizmor job
A separate job runs zizmor — a static analyser that scans GitHub Actions workflow files for security issues such as script injection vulnerabilities, overly broad permissions, and unsafe use of untrusted inputs.
.github/workflows/python-package.yaml (zizmor step)
github/codeql-action/upload-sarif, where findings appear as security alerts on the repository.
check job
A final check job always runs (regardless of whether build or zizmor succeeded or failed) and uses re-actors/alls-green to fail the overall workflow if any upstream job did not succeed. This gives pull requests a single required status check to gate on rather than requiring each individual job to be listed.
.github/workflows/python-package.yaml (check job)