-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
Similar to this ticket and this one filed for the ruff formatter, it would be valuable to apply changes and return 1 . Currently we can only choose one or the other.
All of the arguments in favor of this behavior are in the linked tickets, but here's a summary from my POV:
- It's useful in CI to be able to print a diff of what changed, and it's easy to do that by actually applying the change
- Some repo task runners get tripped up when a tool modifies its inputs without returning a non-zero result: [bug] cache is not invalidated when revisiting a previous file state moonrepo/moon#1959
mdformatdoes not print out any info about files that it changed, so I can't do this by parsing output
Proposal
Since ruff is such a popular linter, I propose that we add a flag with the same name: --exit-non-zero-on-format. This flag will tell mdformat to return non-zero if any files were modified.
This would be a super quick fix, so I'm happy to make the change myself if there are no objections.
KyleKing
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request