We have a good pre-commit hook for GIT, as well as a good commit-msg. The pre-commit hook performs syntax checking, and commit-msg does some other business logic. Everything works well.
However, I would like to add a coding standard check on the pre-hook. In fact, this has already been added. However, I do not want to strictly monitor that our developers comply with the coding standards. By default, I would like to check the code for the standards, but if they would like to pass a check on the coding standards, I would like them to pass by adding a parameter to fixing time.
Is it possible to capture / interpret any command line parameter that was set during commit on git at the capture level before commit in order to skip the standard encoding check in the pre-commit hook (optional?)
Or is this only possible when intercepting a message before committing by analyzing the commit message for a specific substring?
Share your recommendations on how (and where) to create conditional code with a controlled command line using the git pre-commit hook (or other git hooks).
source share