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

cli: Implement d2 fmt --check #2253

Merged
merged 6 commits into from
Dec 30, 2024
Merged

Conversation

nwalters512
Copy link
Contributor

@nwalters512 nwalters512 commented Dec 16, 2024

This PR implements a --check flag as described in #1180. I followed what Prettier does: it logs a warning for each unformatted file, and if any were found, it prints the number of unformatted files and a "run XYZ to fix" message.

Closes #1180.

@nwalters512 nwalters512 marked this pull request as ready for review December 16, 2024 23:38
Copy link
Collaborator

@alixander alixander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 thorough PR!

e2etests-cli/main_test.go Show resolved Hide resolved
Copy link
Collaborator

@alixander alixander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@alixander alixander merged commit f2bac02 into terrastruct:master Dec 30, 2024
3 checks passed
@nwalters512 nwalters512 deleted the fmt-check branch December 30, 2024 16:26
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.

d2 fmt --check
2 participants