FlamingTempura / bibtex-tidy

Cleaner and Formatter for BibTeX files
https://flamingtempura.github.io/bibtex-tidy/
MIT License
832 stars 63 forks source link

Feature request: allow checking files without modification #388

Open raphCode opened 1 year ago

raphCode commented 1 year ago

I really like to set up pre-commit hooks of code formatters and such to ensure consistent code styling in my repos. I don't want automatic changes to my commits to happen, so I usually operate these formatter in "check" mode: They don't perform any changes and report via exit status if the files are formatted correctly. If the check fails, my commit is blocked and I am forced to step in by running the formatter manually or forcing an unchecked commit.

Basically, I would like to see this functionality from bibtex-tidy as well: With the --check option, no changes are performed and the exit code is zero if the file is already correctly formatted.