Skip to content

xpd rules verify-fixes

Run xpd rules verify-fixes to test rule autofixes across a directory or corpus completely in memory without modifying any file on disk. It applies each fixable rule through the lazy single-pass engine, parses every rewritten Python file with LibCST, and runs a second pass to verify convergence and idempotence.

Terminal window
xpd rules verify-fixes [OPTIONS] [PATHS]...
Argument What it does
<PATHS>... Files or directories to verify.
Option Default What it does
--unsafe-fixes Include fixes marked unsafe.
--verify-plans Also verify single-file parameterized fix plans in memory using their top candidates.
--rule <NAME> Select a rule or package. Repeat to select several. Repeatable.
-c, --config <PATH> The project file to read instead of the nearest sgconfig.yml.
--format <FORMAT> Output format. Defaults to text on a terminal and JSON otherwise. Values: text, json.
-j, --jobs <NUM> Maximum number of worker threads.
Terminal window
$ xpd rules verify-fixes samples/good.py --format json | jq -c '{files_scanned, files_modified, total_fixes, parse_failures, idempotence_failures, pass_limit_failures}'
{"files_scanned":1,"files_modified":0,"total_fixes":0,"parse_failures":0,"idempotence_failures":0,"pass_limit_failures":0}
Check Failure kind Meaning
Convergence pass-limit Autofix hit the maximum pass limit without converging
Syntax parse A rewritten file failed syntax validation
Idempotence idempotence A second fix pass modified the file again
Flag Purpose
--unsafe-fixes Verify unsafe fixes in addition to safe fixes
--rule <NAME> Restrict verification to one or more packages or rules
--config <PATH> Load project rules from a specific sgconfig.yml
--format <text|json> Print a summary or structured JSON with by_rule, failures, and elapsed_ms
Exit code Meaning
0 Every rewritten file parsed cleanly and converged idempotently
1 One or more files failed convergence, syntax, or idempotence checks
2 The command could not run