Repository navigation
build(nix): source ruff/ruff-format/typos pre-commit hooks from the flake - #699
Merged
c-vigo merged 3 commits intoJun 24, 2026
Merged
Conversation
…lake Add ruff and typos to the flake devTools SSoT and convert the ruff, ruff-format, and typos pre-commit hooks to repo: local / language: system so they resolve their tool from the Nix dev-shell instead of upstream manylinux wheels, which a NixOS host cannot execute. Remove the now-duplicate ruff entry from imageTools (it inherits ruff from devTools). Re-sync the scaffolded assets/workspace/.pre-commit-config.yaml and the CHANGELOG copy. Refs: #697
The venv's ruff (a manylinux wheel) shadowed the flake ruff under `uv run` — which is how .githooks/pre-commit and the `just lint`/`format` recipes invoke it — so ruff stayed broken on NixOS even after it was added to devTools. Remove ruff from the uv dependency groups (pyproject.toml/uv.lock) and repoint the recipes to the flake ruff; the flake is now the single ruff source (its [tool.ruff] config is unchanged). Refs: #697
Contributor
Author
|
Extended this PR to fully close the ruff gap (per review): removed |
6 tasks
c-vigo
added a commit
that referenced
this pull request
Jun 24, 2026
…ooks #699 converted ruff/ruff-format/typos to repo-local language:system hooks and synced that into the scaffolded config. A downstream workspace commits inside the published image without the flake toolchain on PATH, so those hooks fail with "Executable not found" (the integration suite caught this on the typos hook). Add a ReplacePrecommitRepoBlock sync-manifest transform that restores self-contained upstream ruff/typos hooks in the scaffolded config only; the repo's own config keeps language:system for NixOS-host dev. Refs: #697
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On a NixOS host, the
ruff,ruff-format, andtypospre-commit hooks couldnot run because they were sourced from upstream
astral-sh/ruff-pre-commitandcrate-ci/typosas generic-linux (manylinux) wheels, which NixOS cannot executeout of the box (no FHS
ld-linux). This forced--no-verifyon every localcommit. This PR sources those tools from the Nix flake (the #625 toolchain
SSoT) via
language: systemhooks, consistent with the other local hooks(
taplo,just,nixfmt,uv run ...).Sub-issue of the #625 Nix-migration epic.
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
flake.nix: addedruffandtyposto thedevToolsSSoT list (keptnixfmt-clean). Removed the now-duplicateruffentry fromimageTools(it inherits
rufffromdevTools)..pre-commit-config.yaml: replaced theastral-sh/ruff-pre-commitandcrate-ci/typosrepo blocks withrepo: local/language: systemhooks —ruff(entry: ruff check --fix,types: [python]),ruff-format(
entry: ruff format,types: [python]),typos(entry: typos).Existing behaviour/args/filters preserved.
assets/workspace/.pre-commit-config.yamlviascripts/sync_manifest.py.CHANGELOG.md: added a### Fixedentry under## Unreleased; re-synced the.devcontainerCHANGELOG copy.tests/test_flake_devshell.py: added a parity assertion thatruffandtyposare indevShellTools(mirrors the existing bats / agent-toolkitsuperset tests).
Changelog Entry
Fixed
ruff,ruff-format, andtyposhooks pulled compiled tools as generic-linux (manylinux) wheels fromastral-sh/ruff-pre-commitandcrate-ci/typos; a NixOS host cannot execute those binaries out of the box (no FHSld-linux), forcing--no-verifyon every local commitruffandtyposto the flakedevToolsSSoT and converted the three hooks torepo: local/language: system(ruff check --fix,ruff format,typos), so they resolve their tool from the Nix dev-shell like the other local hooks — no host setup needed inside the dev-shell. Re-synced the scaffoldedassets/workspace/.pre-commit-config.yaml. Hook versions now tracknixpkgs/flake.lock(Renovatenixmanager) instead of upstreamrev:pins, consistent with the [MASTER] Migrate devcontainer to a Nix toolchain + Claude-native setup #625 toolchain consolidationTesting
just test)Manual Testing Details
Run on a NixOS host (
export NIX_CONFIG="experimental-features = nix-command flakes"):uv run pytest tests/test_flake_devshell.py→ 7 passed (newtest_devshell_provides_precommit_binary_hookswas RED before the flakechange, GREEN after).
nix develop -c ruff --version→ruff 0.15.14;nix develop -c typos --version→typos-cli 1.46.3.nix develop -c bash -c 'uv run pre-commit run typos --all-files'→ Passed(resolved from the flake).
nixfmt --check flake.nix→ clean;nix evalof.#devShells.<sys>.default.drvPathand.#checks.<sys>evaluate(
devShell,devShellTools,format).Commits used
git commit --no-verify: the very hooks being fixed(
ruff/ruff-format/typos) cannot execute on this NixOS host pre-fix, whichis the bug. CI re-runs the full pre-commit suite under
provision-via-flake(FHS runner) so the PR is still gated.
Reviewer note — known gap for
ruff/ruff-format:ruffis also aproject Python dependency (
pyproject.tomllint/devcontainergroups), so.venv/bin/ruff(a manylinux wheel) exists. Bothjustfile(just lint/just format/just precommit) and CI launch pre-commit viauv run, whichputs
.venv/binfirst onPATHand shadows the flake'sruff. On a NixOShost this means the
ruff/ruff-formathooks still hit the broken venv binaryunder
uv run pre-commit, whereastypos(not a venv dep) resolves cleanlyfrom the flake. Fully closing the
ruffcase requires removingrufffrom theproject venv and repointing
justfile'slint/formatrecipes at the flakeruff(and refreshinguv.lock) — changes that touchpyproject.toml,uv.lock, andjustfile, which are outside this issue's stated scope (andoverlap with sibling #698). Flagging for a decision: extend this PR, or split a
follow-up. CI stays green regardless because the FHS runner can execute the venv
ruff wheel.
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The docs acceptance-criterion item (note that pre-commit runs inside the
dev-shell, no host setup) is intentionally left for a docs pass / the #698
sibling that is also editing the Nix docs; this PR keeps a minimal diff focused
on the flake + hook config.
Merge-conflict heads-up: sibling issue #698 (in progress in parallel) also
edits
flake.nix(devTools/mkShell),.pre-commit-config.yaml, andCHANGELOG.md. Expect conflicts in: thedevToolslist region offlake.nix,the pre-commit hook blocks, and the
## Unreleased### Fixedsection ofCHANGELOG.md(and its syncedassets/workspace/.devcontainer/CHANGELOG.mdcopy).
Refs: #697