Skip to content

Add --dry-run flag to pyrefly infer #3920

Description

@mdbernard

Describe the Bug

I'm finding it very useful to have pyrefly infer run as part of our code formatter. In continuous integration, we have a check verifying whether the formatter would make any changes. This is not currently possible with pyrefly infer, since it doesn't have a dry-run/check-only mode.

I propose adding a --dry-run flag to pyrefly infer which simply prints out what changes would be made, with an exit code of 0 if no changes would be made and an exit code of 1 if any changes would be made. This would enable the above continuous integration usage for pyrefly infer.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

help wantedLarger than "good first issue", but still well-defined and ready for someone to pick upinferof or related to pyre infer
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions