Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/grunt-bootlint.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2015-11-17 17:32:21 +0300
committerXhmikosR <xhmikosr@gmail.com>2015-11-25 19:48:58 +0300
commita614a4c41c0c9e2a8bc3f7e81a6a9677ef9c5c05 (patch)
treedc452e1fd515c7d326c75d1615253b288f8e5d5e /tasks
parent669b11ebe7fe14d14e3d4e077b2e56c3caf5cbc6 (diff)
Make use of `grunt.util.pluralize`.
Diffstat (limited to 'tasks')
-rw-r--r--tasks/bootlint.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/tasks/bootlint.js b/tasks/bootlint.js
index 64f49ae..9208662 100644
--- a/tasks/bootlint.js
+++ b/tasks/bootlint.js
@@ -73,14 +73,20 @@ module.exports = function(grunt) {
totalFileCount++;
});
- if (totalErrCount > 0 && !options.showallerrors) {
- grunt.log.writeln().fail(totalErrCount + ' lint error(s) found across ' + totalFileCount + ' file(s).');
- grunt.log.writeln().fail('For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki');
- } else if (totalErrCount > 0 && options.showallerrors) {
- grunt.fail.warn(totalErrCount + ' lint error(s) found across ' + totalFileCount + ' file(s).');
+ var errorStr = grunt.util.pluralize(totalErrCount, 'error/errors');
+ var fileStr = grunt.util.pluralize(totalFileCount, 'file/files');
+
+ if (totalErrCount > 0) {
+ if (options.showallerrors) {
+ grunt.fail.warn(totalErrCount + ' lint ' + errorStr + ' found across ' + totalFileCount + ' ' + fileStr + '.');
+ } else {
+ grunt.log.writeln().fail(totalErrCount + ' lint ' + errorStr + ' found across ' + totalFileCount + ' ' + fileStr + '.');
+ grunt.log.writeln().fail('For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki');
+ }
} else {
- grunt.log.ok(totalFileCount + ' file(s) lint free.');
+ grunt.log.ok(totalFileCount + ' ' + fileStr + ' lint free.');
}
+
});
function getDisabledIdsForFilepath(filepath) {