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:
authorZac Echola <zac.echola@so.mnscu.edu>2014-11-18 00:18:18 +0300
committerZac Echola <zac.echola@so.mnscu.edu>2014-11-18 00:18:18 +0300
commitf3329e6eba193f8ca8445e8ae4032d95f53af0c0 (patch)
tree045e836f148dd136099a7ce2ef844ad6981da50b /tasks
parent3322682746008d93ce2d77f32e3075d4cf94bdca (diff)
adding showallerrors option
Diffstat (limited to 'tasks')
-rw-r--r--tasks/bootlint.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/tasks/bootlint.js b/tasks/bootlint.js
index 0eb5eff..8913b58 100644
--- a/tasks/bootlint.js
+++ b/tasks/bootlint.js
@@ -17,6 +17,7 @@ module.exports = function(grunt) {
var options = this.options({
stoponerror: false,
stoponwarning: false,
+ showallerrors: false,
relaxerror: []
});
@@ -53,14 +54,16 @@ module.exports = function(grunt) {
});
}
+
if (!output) {
grunt.log.warn(filepath + ":", lintId, lint.message);
totalErrCount++;
}
- console.log((isError && options.stoponerror) || (isWarning && options.stoponwarning));
- if ((isError && options.stoponerror) || (isWarning && options.stoponwarning)) {
- grunt.fail.warn('Too many bootlint errors.');
+ if (!options.showallerrors) {
+ if ((isError && options.stoponerror) || (isWarning && options.stoponwarning)) {
+ grunt.fail.warn('Too many bootlint errors.');
+ }
}
};
@@ -69,9 +72,11 @@ module.exports = function(grunt) {
totalFileCount++;
});
- if (totalErrCount > 0) {
+ 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). ");
} else {
grunt.log.ok(totalFileCount + ' file(s) lint free.');
}