Skip to main content

Module auto_fix

Module auto_fix 

Source
Expand description

Pre-write validation and auto-fix for edited content.

All checks operate on in-memory content — nothing is written to disk. The caller is responsible for writing the validated/fixed content.

Post-write syntax check (post_edit_syntax_check) needs the file on disk (runs external commands like node --check) and is called separately after write.

Structs§

ValidateResult
Result of validate_and_fix: the (possibly fixed) content, any warnings, and whether any auto-fix was applied.

Functions§

post_edit_syntax_check
Post-edit syntax check for common file types. Runs a fast, non-destructive check and returns a warning if syntax is broken. This needs the file to be on disk — call AFTER writing.
validate_and_fix
Run all pre-write validations on the content in memory: