gui-tool
Version:
Generating of ExtJS prototypes and skeleton applications with Siesta tests has never been so easy and fast.
36 lines (30 loc) • 820 B
JavaScript
require('colors');
var Table = require('cli-table');
module.exports = function(errorsCollection) {
var err = 0,
table = new Table({
head: ['File'.white.bold, 'Errors'.white.bold],
colWidths: [30, 30]
});
errorsCollection.forEach(function(errors) {
var file = errors.getFilename(),
errorsCount = errors.getErrorList().length;
if (!errors.isEmpty()) {
table.push(
[file, errorsCount]
);
err += errorsCount;
}
});
err += '';
if (err > 0) {
table.push(
['Total'.red.bold, err.red.bold]
);
} else {
table.push(
['Total'.green.bold, err.green.bold]
);
}
console.log('JSCS check\n' + table.toString());
};