Skip to content

Add --dry-run flag to fix command to preview diff without writing #32

@AK11105

Description

@AK11105

What problem does this solve?

inference-engine fix always writes changes to disk. There is no way to inspect what it would change before committing — making it unsafe to run in CI for review purposes, and risky to run locally when you're unsure whether the fix is correct.

Proposed solution

Add --dry-run to the fix subcommand. Prints the unified diff and exits without writing or prompting.

inference-engine fix models/sentiment/v1/ --sample-input "great movie" --dry-run

Output:

--- models/sentiment/v1/definition.py (original)
+++ models/sentiment/v1/definition.py (fixed)
@@ -12,7 +12,7 @@
     def load(self) -> None:
-        self._model = pickle.load(open(self._path, "rb"))
+        self._model = joblib.load(self._path)

The diff display already exists in run_fix(). This is purely a flag that skips the write step and the confirmation prompt.

Alternatives considered

Reading the diff output from stdout and deciding manually. The diff is already printed before the write prompt — --dry-run just makes "don't write" the default rather than requiring the user to answer n.

Area

CLI (deploy / fix)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions