packages/cz-changelog-peakfijn/commitlint-utils.js
function reportSummary(report = {}) {
	if (reportIsValid(report)) {
		return '';
	}

	const countErrors = report.errors.length;
	const countWarnings = report.warnings.length;
	const color = countErrors > 0 ? 'red' : 'yellow';

	const summaries = [];
	const issues = [];

	if (countErrors > 0) {
		summaries.push(chalk`{red ${countErrors}} ${countErrors === 1 ? 'error' : 'errors'}`);
		report.errors.forEach(error => {
			issues.push(chalk`  {bold.red -} ${error.message} {dim ${error.name}}`);
		});
	}

	if (countWarnings > 0) {
		summaries.push(chalk`{yellow ${countWarnings}} ${countWarnings === 1 ? 'warning' : 'warnings'}`);
		report.warnings.forEach(warning => {
			issues.push(chalk`  {bold.yellow -} ${warning.message} {dim ${warning.name}}`);
		});
	}

	const summary = summaries.length > 0 ? chalk`{dim ${summaries.join(', ')}}` : '';
	const header = chalk`{bold.${color} !} {bold Final commit violates conventions} ${summary}`;
	const footer = chalk`{dim aborted commit}`;

	return `${header}\n${issues.join('\n')}\n\n  ${footer}`;
}
function reportSummary(report = {}) {
	if (reportIsValid(report)) {
		return '';
	}

	const countErrors = report.errors.length;
	const countWarnings = report.warnings.length;
	const color = countErrors > 0 ? 'red' : 'yellow';

	const summaries = [];
	const issues = [];

	if (countErrors > 0) {
		summaries.push(chalk`{red ${countErrors}} ${countErrors === 1 ? 'error' : 'errors'}`);
		report.errors.forEach(error => {
			issues.push(chalk`  {bold.red -} ${error.message} {dim ${error.name}}`);
		});
	}

	if (countWarnings > 0) {
		summaries.push(chalk`{yellow ${countWarnings}} ${countWarnings === 1 ? 'warning' : 'warnings'}`);
		report.warnings.forEach(warning => {
			issues.push(chalk`  {bold.yellow -} ${warning.message} {dim ${warning.name}}`);
		});
	}

	const summary = summaries.length > 0 ? chalk`{dim ${summaries.join(', ')}}` : '';
	const header = chalk`{bold.${color} !} {bold Final commit violates conventions} ${summary}`;
	const footer = chalk`{dim aborted commit}`;

	return `${header}\n${issues.join('\n')}\n\n  ${footer}`;
}
function reportSummary ( report = { } ) { if ( reportIsValid ( report ) ) { return '' ; } const countErrors = report . errors . length ; const countWarnings = report . warnings . length ; const color = countErrors > 0 ? 'red' : 'yellow' ; const summaries = [ ] ; const issues = [ ] ; if ( countErrors > 0 ) { summaries . push ( chalk ` ${ countErrors } ${ countErrors === 1 ? 'error' : 'errors' } ` ) ; report . errors . forEach ( error => { issues . push ( chalk ` ${ error . message } ${ error . name } ` ) ; } ) ; } if ( countWarnings > 0 ) { summaries . push ( chalk ` ${ countWarnings } ${ countWarnings === 1 ? 'warning' : 'warnings' } ` ) ; report . warnings . forEach ( warning => { issues . push ( chalk ` ${ warning . message } ${ warning . name } ` ) ; } ) ; } const summary = summaries . length > 0 ? chalk ` ${ summaries . join ( ', ' ) } ` : '' ; const header = chalk ` ${ color } ${ summary } ` ; const footer = chalk ` ` ; return ` ${ header } \n ${ issues . join ( '\n' ) } \n \n ${ footer } ` ; }
Log the provided lint report to the console.
It should contain all information for the user to understand a possible rejection.

@param  {Object} report
@return {string}
Log the provided lint report to the console . It should contain all information for the user to understand a possible rejection .