build: run formatting automatically on pre-commit hook (#38402)

Runs the `ng-dev format changed` command whenever the `git commit` command is
run.  As all changes which are checked by CI will require this check passing, this
change can prevent needless roundtrips to correct lint/formatting errors. This
automatic formatting can be bypassed with the `--no-verify` flag on the `git commit`
command.

PR Close #38402
This commit is contained in:
Joey Perrott 2020-08-11 16:09:00 -07:00 committed by Andrew Kushnir
parent 28534d83ee
commit a2e069fdda
1 changed files with 1 additions and 0 deletions

View File

@ -209,6 +209,7 @@
"cldr-data-coverage": "full", "cldr-data-coverage": "full",
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "yarn -s ng-dev format staged",
"commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS" "commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS"
} }
} }