Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vfmt: exit with error code if encountering diffs with -diff flag #21603

Merged
merged 2 commits into from
May 30, 2024

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented May 29, 2024

Currently, it's hard to combine a diff-output while also verifying that paths are formatted.

Up to now I'm doing contortions like:

v fmt -verify <path> && exit 0 || v fmt -diff <path> && exit 1

v fmt -verify -diff is not possible either, since the single flags do return early.

With the changes, the -diff flag will cause an exit code 1 if diffs are encountered. This is equivalent to diff tools like diff.

@spytheman spytheman merged commit 52dfef1 into vlang:master May 30, 2024
30 checks passed
@ttytm ttytm deleted the fmt/diff-errror branch May 30, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants