Commit 0f801a93 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix output format

parent b7a05622
...@@ -25,7 +25,7 @@ module.exports = class LintingFormatter { ...@@ -25,7 +25,7 @@ module.exports = class LintingFormatter {
position = ' ' + position; position = ' ' + position;
} }
formattedMessage += `${chalk.white(position)} ${chalk.yellow('')} ${_message.message}` + formattedMessage += `${chalk.white(position)} ${chalk.yellow('')} ${_message.message}` +
`${chalk.white(` (Violated rule ${chalk.italic(_message.ruleId)})`)}`; `${chalk.white(` (Violated rule ${chalk.italic(_message.ruleId)})`)}\n`;
}); });
return formattedMessage; return formattedMessage;
} }
......
...@@ -226,7 +226,12 @@ module.exports = class Css extends Task { ...@@ -226,7 +226,12 @@ module.exports = class Css extends Task {
} }
}) })
}; };
return `\n${LintingFormatter.format(error)}\n`; let errorMessage = `${LintingFormatter.format(error)}`;
if (!this._printedError) {
errorMessage = `\n${errorMessage}`;
this._printedError = true;
}
return errorMessage;
} }
}) })
]).process(file, { ]).process(file, {
......
...@@ -195,17 +195,16 @@ module.exports = class Js extends Task { ...@@ -195,17 +195,16 @@ module.exports = class Js extends Task {
if (report.errorCount > 0) { if (report.errorCount > 0) {
this._logger.displayNotification('SGC js:qa task', 'You have some linting-errors in your JavaScript. Please fix them!'); this._logger.displayNotification('SGC js:qa task', 'You have some linting-errors in your JavaScript. Please fix them!');
} }
let foundError = 0; let printedError = false;
report.results.forEach((_error) => { report.results.forEach((_error) => {
if (_error.errorCount > 0 || _error.warningCount > 0) { if (_error.errorCount > 0 || _error.warningCount > 0) {
foundError = true; if (!printedError) {
console.log(); console.log();
printedError = true;
}
console.log(LintingFormatter.format(_error)); console.log(LintingFormatter.format(_error));
} }
}); });
if (foundError) {
console.log();
}
resolve(); resolve();
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment