diff --git a/ng-dev/commit-message/validate.spec.ts b/ng-dev/commit-message/validate.spec.ts index 2963fd751..800ed665a 100644 --- a/ng-dev/commit-message/validate.spec.ts +++ b/ng-dev/commit-message/validate.spec.ts @@ -377,6 +377,17 @@ describe('validate-commit-message.js', () => { expectValidationResult(validateCommitMessage(incorrectKeyword3), INVALID, [ 'The commit message body contains an invalid deprecation note.', ]); + + const incorrectKeyword4 = + 'feat(compiler): this is just a usual commit message title\n\n' + + 'This is a normal commit message body which does not exceed the max length\n' + + 'limit. For more details see the following super long URL:\n\n' + + 'DEPRECATION:\n' + + ' * A to be removed\n' + + ' * B to be removed'; + expectValidationResult(validateCommitMessage(incorrectKeyword4), INVALID, [ + 'The commit message body contains an invalid deprecation note.', + ]); }); }); diff --git a/ng-dev/commit-message/validate.ts b/ng-dev/commit-message/validate.ts index bc9fafa4a..175878387 100644 --- a/ng-dev/commit-message/validate.ts +++ b/ng-dev/commit-message/validate.ts @@ -46,10 +46,11 @@ const INCORRECT_BREAKING_CHANGE_BODY_RE = * * - `DEPRECATED ` | Here we assume the colon is missing by accident. * - `DEPRECATIONS: ` | The wrong keyword is used here. + * - `DEPRECATION: ` | The wrong keyword is used here. * - `DEPRECATE: ` | The wrong keyword is used here. * - `DEPRECATES: ` | The wrong keyword is used here. */ -const INCORRECT_DEPRECATION_BODY_RE = /^(DEPRECATED[^:]|DEPRECATIONS|DEPRECATE:|DEPRECATES)/m; +const INCORRECT_DEPRECATION_BODY_RE = /^(DEPRECATED[^:]|DEPRECATIONS?|DEPRECATE:|DEPRECATES)/m; /** Validate a commit message against using the local repo's config. */ export function validateCommitMessage(