---
title: "2026-08-27 Infrastructure Python lint consistency audit"
description: "Audited monorepo Python lint wiring across Pixi, Nx, Ruff, ast-grep, Lefthook, and CI."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-08-27 Infrastructure Python lint consistency audit

## 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.

Source: https://docs.virdx.dev/knowledge/inbox/2026-08-27-infrastructure-python-lint-consistency-audit/index.mdx
