feat(dev-infra): validate deprecation notes in commit messages (#42436)
Currently the commit message validation tool from `ng-dev` validates the `BREAKING CHANGE:` commit message notes. This commit adds a similar check for `DEPRECATED:` commit message notes. Additionally, the check for breaking changes is reworked slightly to be more tolerant (i.e. if there is only a single line break after the summary; this is acceptable as per the parser and commonly done in the COMP repo). The checks have been updated to capture wrong keywords that are commonly used instead of the correct one. e.g. if a commit message uses `DEPRECATIONS:` instead of `DEPRECATED:`, the validation will fail. This prevents changelog generation issues where breaking change notes, or deprecations are missing. This happened in the COMP repo where the `DEPRECATED:` keyword was used incorrectly. See: https://github.com/angular/components/commit/99391e79391d20c6ef2f95a3ea4fd6901dcb631d PR Close #42436
This commit is contained in:
committed by
Andrew Kushnir
parent
c0b2eeb54c
commit
bc5a8f4d37
@@ -111,7 +111,7 @@ const parseOptions: Options&{notesPattern: (keywords: string) => RegExp} = {
|
||||
headerPattern,
|
||||
headerCorrespondence,
|
||||
noteKeywords: [NoteSections.BREAKING_CHANGE, NoteSections.DEPRECATED],
|
||||
notesPattern: (keywords: string) => new RegExp(`(${keywords})(?:: ?)(.*)`),
|
||||
notesPattern: (keywords: string) => new RegExp(`(${keywords}): ?(.*)`),
|
||||
};
|
||||
|
||||
/** Parse a commit message into its composite parts. */
|
||||
|
||||
Reference in New Issue
Block a user