Expand description
Applying the fixes that diagnostics carry (htl fix).
The shape follows what cargo fix, ESLint and Ruff settled on: a fix travels with
its diagnostic and has an applicability class; only safe applies unless asked;
edits that overlap within one pass are deferred to the next, which re-checks the
file; passes are capped; a fix that leaves the file with an error it did not have
is reverted; everything applied is reported, not only what remains. A file the
parser rejects is never touched; type errors do not block (their positions are
sound, and a fix may be what removes them), the revert is the guard.
Structs§
- Applied
- One fix that was (or would be) applied.
- File
Outcome - Everything one file’s run of
fix_filedid, and everything it declined to do. - FixOptions
- What a run of
fix_fileis allowed to do: which fixes count as applicable, which rules are in scope, and whether anything is written. - Skipped
- One fix that was not applied, and why.
Constants§
- MAX_
PASSES - Passes per file before giving up (cargo fix uses 4).
Functions§
- fix_
file - Fix one file in place (or in memory with
dry_run). The checker’s search path must already cover the project. - git_
dirty - Is
pathclean in git?Ok(None)when it is not inside a repository. - unified_
diff - A unified diff of
before->after(LCS on lines, 3 lines of context).