Expand description
Every problem an editor round trip can leave behind, and the repair tix can apply to each one (tix #1506).
The old flow ended with a run_editor that re-parsed the temp copy and threw
the diagnostic away, so the caller could only report file not valid after edit and the real parse error never reached the user. This module is the
replacement: run_editor no longer validates (its job is to run the editor),
and the callers classify what came back here, where each problem carries the
diagnostic and — where tix can do so safely — a machine-applicable fix.
The taxonomy is deliberately small and closed:
| kind | source | automatic fix |
|---|---|---|
history_not_first | a tix lint history finding | move the section to the top of the body |
unknown_key | a tix lint unknown_key finding | declare the key in [custom_attributes] |
duplicate_key | a YAML duplicate-field parse error | drop the later duplicate, keep the first |
retired_links_key | a tix lint retired_links_key finding | remove the key |
missing_title | an empty title: after the edit | restore the pre-edit title |
history_entry | a hand-edited ## History line | none — reopen the editor |
invalid_value | any other tix lint finding | none — reopen the editor |
unparsable | a frontmatter that will not parse | none — reopen the editor |
Every problem carries a proposal, even when the
only honest proposal is “reopen the editor on the retained copy and fix it by
hand”. A problem with no proposal would be a dead end, which is exactly what
this ticket exists to remove.
Structs§
- Edit
Problem - One classified problem, with the diagnostic and the way out.
Enums§
- EditFix
- A machine-applicable repair.
- Edit
Problem Kind - What kind of post-edit problem this is.
Functions§
- for_
lint_ findings - Classify the findings of a
tix lintpass over the edited file. - for_
parse_ error - Classify a failed
Issue::parse. - missing_
title - A titleless issue’s problem, with the pre-edit title as the fix when there is one to restore.