views:

12

answers:

0

I want to run all Perl files through Perltidy automatically on each commit, so that all submitted code meets a shared formatting standard.

The commitinfo pre-commit hook provides information about the committed files, allowing me to perform logging/notification, but I don't see a way to change the file before it hits the repository.

The following post recommends against this:
http://stackoverflow.com/questions/2060035/using-the-pre-commit-hook-to-clean-code

However, the Perltidy use case is perfect for this functionality; when files are committed, Perltidy would change the format to match company standards, eliminating the need for developers to manually adhere to coding standards they may not like.