Lint
lint
Ruff diagnostic filtering + availability probing for batch_edit's lint step.
batch_edit runs ruff --fix over the files it touched and reports
the diagnostics ruff could not auto-fix. This module holds the helper
that strips ruff's summary noise from that output so only real
diagnostic lines remain, plus the availability probe that decides whether
the lint step runs at all.
Availability is probed per target root by shelling uv run ruff
--version with cwd=root — this detects an env-local ruff even when
no global ruff is on PATH. Results are memoized per resolved root so
repeated edits against the same project do not re-spawn the probe, while a
different root re-probes.
filter_ruff_lines(stdout)
Keep real diagnostic lines, dropping ruff summary noise.
Source code in packages/axm-edit/src/axm_edit/services/lint.py
ruff_available(root)
Return whether ruff can run inside root's environment.
Probes uv run ruff --version with cwd=root and treats ruff as
available iff the subprocess returns 0. A missing uv/ruff binary
(FileNotFoundError) or any OS-level failure counts as absent (a
clean skip), never as a crash. The verdict is memoized on the resolved
absolute root; a distinct root re-probes.