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
diff options
context:
space:
mode:
-rw-r--r--package.json3
-rw-r--r--tasks/bootlint.js26
-rw-r--r--test/bootlint_test.js4
3 files changed, 12 insertions, 21 deletions
diff --git a/package.json b/package.json
index fca3ac6..8d2deb8 100644
--- a/package.json
+++ b/package.json
@@ -33,8 +33,7 @@
"test": "grunt test"
},
"dependencies": {
- "bootlint": "^0.2.0",
- "colors": "^0.6.2"
+ "bootlint": "^0.2.0"
},
"devDependencies": {
"grunt": "~0.4.5",
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);
}
});
});
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index 7654c5c..2abb96e 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -67,8 +67,8 @@ exports.bootlint = {
}, function(err, result) {
test.ok(result.stdout.indexOf("is OK") >= 0,
'Should print filepath is OK!');
- test.ok(result.stdout.indexOf("All Done!") >= 0,
- 'Should print All Done! message');
+ test.ok(result.stdout.indexOf("No Bootlint errors!") >= 0,
+ 'Should print "No Bootlint errors!" message');
test.done();
});
},