Closed craiga closed 3 years ago
Thank you @craiga, that is a great idea! I have implemented it in the latest version. If the option -c
/ --check
is given, no file is written to disk but the exit status is equal to the number of files that would have been modified:
$ djhtml template1.html template2.html template3.html -c
3 templates would have been reindented.
$ echo $?
3
As you can see, the normal output is still there. If you want to suppress it, use -q
:
$ djhtml template1.html template2.html template3.html -cq
$ echo $?
3
If you have any other suggestions you're always welcome to open an issue!
Thanks so much for this tool! I've just applied it to a moderately sized Django project and it worked perfectly, cleaning up all of those inconsistently formatted templates which have been annoying me for a while now.
I'd really like is a command-line option along the lines of black's
--check
option, which one can use in CI to make sure their files are correctly formatted.