feat(dev-infra): migrate commit-message tool to use new logging system (#37422)

Migrate the commit-message tool in ng-dev to use new logging system rather
than directly calling console.* to create a better experience
for users.

PR Close #37422
This commit is contained in:
Joey Perrott
2020-05-20 14:22:29 -07:00
committed by atscott
parent d6e715e726
commit 59abf4a33f
5 changed files with 28 additions and 17 deletions

View File

@ -6,6 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/
import * as yargs from 'yargs';
import {info} from '../utils/console';
import {validateFile} from './validate-file';
import {validateCommitRange} from './validate-range';
@ -51,10 +54,10 @@ export function buildCommitMessageParser(localYargs: yargs.Argv) {
// If on CI, and not pull request number is provided, assume the branch
// being run on is an upstream branch.
if (process.env['CI'] && process.env['CI_PULL_REQUEST'] === 'false') {
console.info(
`Since valid commit messages are enforced by PR linting on CI, we do not\n` +
`need to validate commit messages on CI runs on upstream branches.\n\n` +
`Skipping check of provided commit range`);
info(`Since valid commit messages are enforced by PR linting on CI, we do not`);
info(`need to validate commit messages on CI runs on upstream branches.`);
info();
info(`Skipping check of provided commit range`);
return;
}
validateCommitRange(argv.range);