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@gmail.com>2014-09-26 05:53:41 +0400
committerZac Echola <zac.echola@gmail.com>2014-09-26 05:53:41 +0400
commit4d4c31c16e0ca3384654edab84e2eb68faf54e07 (patch)
treef6f4b239391df6bedf23acc226acbfa82b808dfc /tasks
parent0ce0964a1a87e135b229a64939c345ad0295adcf (diff)
fix #7
Diffstat (limited to 'tasks')
-rw-r--r--tasks/bootlint.js26
1 files changed, 9 insertions, 17 deletions
diff --git a/tasks/bootlint.js b/tasks/bootlint.js
index 3fdc0c4..ec12294 100644
--- a/tasks/bootlint.js
+++ b/tasks/bootlint.js
@@ -10,19 +10,11 @@
module.exports = function(grunt) {
var bootlint = require('bootlint');
- var colors = require('colors');
-
- colors.setTheme({
- ok: 'green',
- error: 'red',
- warning: 'yellow'
- });
var msg = {
- start: 'Validation started for '.ok,
- ok: 'Validation successful!'.ok,
- error: 'Error:'.error,
- done: 'All Done!'.bold.ok
+ start: 'Validation started for ',
+ ok: 'Validation successful!',
+ done: 'No Bootlint errors!'.bold
};
grunt.registerMultiTask('bootlint', 'An HTML linter for Bootstrap projects', function() {
@@ -48,7 +40,7 @@ module.exports = function(grunt) {
var src = grunt.file.read(filepath);
var errs = bootlint.lintHtml(src);
- grunt.log.writeln(msg.start + filepath.ok);
+ grunt.log.writeln(msg.start + filepath);
// Remove relaxed errors
if (options.relaxerror.length) {
@@ -60,20 +52,20 @@ module.exports = function(grunt) {
errs.forEach(function (err) {
totalErrCount += errs.length;
if (options.stoponerror) {
- grunt.fail.warn(filepath + ':' + err.error);
+ grunt.fail.warn(filepath + ':' + err);
} else {
- grunt.log.warn(filepath + ':', err.error);
+ grunt.log.warn(filepath + ':', err);
}
});
- if (!errs.length) { grunt.log.writeln(filepath.ok + ' is OK!'.ok); }
+ if (!errs.length) { grunt.log.ok(filepath + ' is OK! \n'); }
});
if (totalErrCount > 0) {
- grunt.log.writeln(totalErrCount + ' lint errors found.');
+ grunt.log.writeln().fail(totalErrCount + ' lint errors found.');
} else {
- grunt.log.writeln(msg.done);
+ grunt.log.writeln().success(msg.done);
}
});
});