Lint diff
lint_diff
Compute tagged_plus_minus diffs between post-agent and post-lint snapshots.
compute_lint_diffs(post_agent, post_lint, rules_by_file, *, max_ratio=0.5, max_chars=4000)
Compute per-file diffs between post-agent and post-lint snapshots.
Returns one entry per file that was mutated by ruff/claude_fix. Files whose content is unchanged are omitted (no empty list entries).
When the diff exceeds max_ratio * len(post_lint_content) OR
max_chars, the entry falls back to {"file", "rules",
"diff_skipped": "file_reread_recommended"} without a diff key.
Source code in packages/axm-edit/src/axm_edit/services/lint_diff.py
extract_rules_by_file(diagnostics, *, path_resolver=None)
Parse file:line:col: CODE msg diagnostic lines into {file: [codes]}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diagnostics
|
list[str]
|
Concise ruff diagnostic lines. |
required |
path_resolver
|
Callable[[str], str] | None
|
Optional callable mapping raw file path to the key
used by |
None
|