angular-cn/dev-infra
George Kalpakas 364284b0dc fix(dev-infra): ignore comments when validating commit messages (#38438)
When creating a commit with the git cli, git pre-populates the editor
used to enter the commit message with some comments (i.e. lines starting
with `#`). These comments contain helpful instructions or information
regarding the changes that are part of the commit. As happens with all
commit message comments, they are removed by git and do not end up in
the final commit message.

However, the file that is passed to the `commit-msg` to be validated
still contains these comments. This may affect the outcome of the commit
message validation. In such cases, the author will not realize that the
commit message is not in the desired format until the linting checks
fail on CI (which validates the final commit messages and is not
affected by this issue), usually several minutes later.

Possible ways in which the commit message validation outcome can be
affected:
- The minimum body length check may pass incorrectly, even if there is
  no actual body, because the comments are counted as part of the body.
- The maximum line length check may fail incorrectly due to a very long
  line in the comments.

This commit fixes the problem by removing comment lines before
validating a commit message.

Fixes #37865

PR Close #38438
2020-08-21 12:17:14 -07:00
..
bazel fix(dev-infra): add missing BUILD file to dev-infra/bazel:files (#38026) 2020-07-15 12:34:46 -07:00
benchmark feat(dev-infra): add bazel firefox browser with RBE compatibility (#38029) 2020-07-15 12:34:05 -07:00
browsers feat(dev-infra): add bazel firefox browser with RBE compatibility (#38029) 2020-07-15 12:34:05 -07:00
commit-message fix(dev-infra): ignore comments when validating commit messages (#38438) 2020-08-21 12:17:14 -07:00
format refactor(dev-infra): update yargs and typings for yargs (#38470) 2020-08-17 15:30:32 -07:00
pr feat(dev-infra): tooling to check out pending PR (#38474) 2020-08-18 16:22:47 -07:00
pullapprove fix(dev-infra): Ensure conditions with groups do not fail verification (#37798) 2020-07-24 17:59:39 -07:00
release refactor(dev-infra): use the `exec()` helper from `utils/shelljs` whenever possible (#37444) 2020-06-05 09:21:18 -07:00
ts-circular-dependencies refactor(dev-infra): update yargs and typings for yargs (#38470) 2020-08-17 15:30:32 -07:00
utils feat(dev-infra): create a wizard for building commit messages (#38457) 2020-08-18 17:01:14 -07:00
BUILD.bazel fix(dev-infra): fix broken zone.js substitution for dev-infra:npm_package (#38026) 2020-07-15 12:34:46 -07:00
cli.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
index.bzl refactor(dev-infra): allow for consumption with rules_nodejs v2.0.0 (#37968) 2020-07-13 14:18:22 -07:00
ng-dev build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tmpl-package.json feat(dev-infra): update to latest benchpress version (#38440) 2020-08-13 09:09:31 -07:00