Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Add quiet / exit code option #11

Closed
alexjurkiewicz opened this issue Jul 12, 2017 · 1 comment
Closed

Add quiet / exit code option #11

alexjurkiewicz opened this issue Jul 12, 2017 · 1 comment

Comments

@alexjurkiewicz
Copy link

alexjurkiewicz commented Jul 12, 2017

I'd like to use hclfmt to ensure my files are correctly formatted before committing changes to my repo. It would be nice if hclfmt would have an option which simply checks if a file has "incorrect" formatting and exits 1 if so (0 if everything is fine). eg hclfmt -q main.tf

Currently I can work around this issue by diffing the output against the source file, but this is a little painful.

@fatih
Copy link
Owner

fatih commented Jul 16, 2017

Hi @alexjurkiewicz

Thanks for the suggestion. The problem is that we can't detect an "incorrect" before writing. There is no incorrect things. If you run it, it'll successfully format it. If not it'll return with exit status 1 already. So I think this would be good enough. Thanks. Let me know if you think this is not sufficient.

@fatih fatih closed this as completed Jul 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants