brucemiller/LaTeXML — pull request #25 by dginev (2013-12-09 06:24:43+00:00)
Title: Git precommit hook

I am proposing a first version of a pre-commit hook for LaTeXML development.

It runs Bruce's perltidy profile and complains for every file Added or Modified file where perltidy is not effectively a no-op. It also suggests the right command to process any file that has issues.

Several things I figured out along the way:
* the pre-commit hook can't (or at least shouldn't) modify the contents of a commit, instead it should only act as a yes/no filter.
* Similarly, nothing inside the .git/ subdirectory can be committed to the repository. So I added a workaround of initially adding pre-commit to tools/ and moving it in the .git/hooks directory during the "make" pass.

So every commit after ```perl Makefile.PL ; make``` has run once will undergo perltidy scrutiny. I wanted to extend with perlcritic as well, but it seems the policies in latexml.perlcritic are still too ambitious for most files to comply.