Swift Review: PR Safety & Risk Analysis
Analyze the semantic impact of your changes and catch potential regressions before they land.
Commands
# Review diff against current HEAD
scripts/swift_review
# Review diff against a specific target branch
scripts/swift_review --target <BRANCH>
Workflow
- Analyze: Run
scripts/swift_reviewto see the semantic impact of your changes - Assess risk: Look for "High Impact" warnings (high Fan-In files) — these are the most dangerous changes to get wrong
- Verify: For each file mentioned in the "Impacted Files" list, run its specific tests to confirm nothing broke
- Proceed: Only commit when high-risk areas are covered by tests
Gotchas
- Always run this BEFORE committing — not after. The tool analyzes uncommitted changes by default.
- "High Impact" means the file has many dependents (high Fan-In). Changes to these files have a larger blast radius and need more careful testing.
- If no tests exist for an impacted file, flag it for manual review — the tool cannot verify correctness without tests.
- When using
--target, make sure the target branch is up to date locally — stale branches produce misleading diffs.