Provide git hooks for code formatting
Description
Based on !753 (comment 480361352), we should provide a git hook help run ament_uncrustify
before creating an MR that might fail just because of code formatting.
Other hooks for the commit message could help with the pain there as well
Expected behavior
I am not sure if the hook should be run automatically but that would be my preference. Occasionally one wants to do a dirty commit but I think a prepush
pre-commit
hook that enforces proper code formatting would be the best combination of safety and comfort.
Definition of Done
-
the hook is fast to run; i.e., <= 10 s -
the hook is invoked automatically before pushing to a fork -
the hook can be deactivated manually -
the hook is mentioned in the contributor guidelines -
other hooks for proper commit messages are added
Edited by Frederik Beaujean