Skip to content

Lint

lint

Ruff diagnostic filtering for batch_edit's post-apply 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.

filter_ruff_lines(stdout)

Keep real diagnostic lines, dropping ruff summary noise.

Source code in packages/axm-edit/src/axm_edit/services/lint.py
Python
def filter_ruff_lines(stdout: str) -> list[str]:
    """Keep real diagnostic lines, dropping ruff summary noise."""
    return [
        line
        for line in stdout.strip().splitlines()
        if line.strip() and not line.startswith(_RUFF_NOISE_PREFIXES)
    ]