Skip to content

2026-08-27 Infrastructure Python lint consistency audit

Audited monorepo Python lint wiring across Pixi, Nx, Ruff, ast-grep, Lefthook, and CI.

Work Done

  • Audited all ten Python projects on chore/linters without editing the monorepo.
  • Verified every Nx lint target delegates to its Pixi lint task and uses the shared pythonLint input.
  • Verified C901 and PLC2701 coverage, targeted Import Linter contracts, ast-grep severity exit behavior, Lefthook hooks, and PR CI.
  • Ran all ten Python Nx lint targets successfully.
  • Found that the blocking ast-grep replacement script remains untracked, and that Lefthook does not run ast-grep when only rule/config files change.

Lessons Learned: Pitfalls

  • The worktree includes uncommitted post-merge changes, so auditing only committed HEAD would miss the intended blocking ast-grep state.
  • C901 configuration is split between pyproject.toml and extending ruff.toml files, which makes a simple manifest-only check incorrectly report gaps.

Lessons Learned: Improvements

  • A small repository lint-wiring audit script could enumerate Python projects and assert Pixi/Nx delegation, shared inputs, and required Ruff/private-import checks.
  • Document whether ast-grep rule changes must trigger a dedicated pre-commit hook; CI covers them through Nx inputs, but Lefthook currently does not.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close