Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add boring

  • Loading branch information...
commit 2805173b89f988a854347407fb37ee836f5835c7 1 parent ad4c1bc
@zxcabs zxcabs authored
Showing with 11 additions and 8 deletions.
  1. +3 −2 bin/jslint.js
  2. +8 −6 lib/reporter.js
View
5 bin/jslint.js
@@ -11,7 +11,8 @@ function commandOptions () {
'debug', 'devel', 'es5', 'evil', 'forin', 'fragment',
'newcap', 'node', 'nomen', 'on', 'onevar', 'passfail',
'plusplus', 'regexp', 'rhino', 'undef', 'safe', 'windows',
- 'strict', 'sub', 'white', 'widget', 'goodparts', 'json'
+ 'strict', 'sub', 'white', 'widget', 'goodparts', 'json',
+ 'boring'
];
var commandOpts = {
@@ -80,7 +81,7 @@ function lintFile(file) {
if (parsed.json) {
console.log(JSON.stringify([file, lint]));
} else {
- reporter.report(file, lint);
+ reporter.report(file, lint, parsed);
}
maybeExit(lint);
});
View
14 lib/reporter.js
@@ -3,10 +3,10 @@
var color = require("./color");
var log = console.log;
-exports.report = function(file, lint) {
+exports.report = function(file, lint, opt) {
- var options = [], key, value,
- i, len, pad, e, fileMessage = "\n" + color.bold(file);
+ var options = [], key, value, line,
+ i, len, pad, e, fileMessage = "\n" + ((opt.boring)? file: color.bold(file));
for (key in lint.options) {
value = lint.options[key];
@@ -23,13 +23,15 @@ exports.report = function(file, lint) {
}
e = lint.errors[i];
if (e) {
- log(pad + ' ' + color.yellow(e.reason));
+ line = ' // Line ' + e.line + ', Pos ' + e.character;
+
+ log(pad + ' ' + ((opt.boring)? e.reason: color.yellow(e.reason)));
log( ' ' + (e.evidence || '').replace(/^\s+|\s+$/, "") +
- color.grey(' // Line ' + e.line + ', Pos ' + e.character));
+ ((opt.boring)? line: color.grey(line)));
}
}
} else {
- log(fileMessage + " is " + color.green("OK") + ".");
+ log(fileMessage + " is " + ((opt.boring)? 'OK': color.green('OK')) + ".");
}
return lint.ok;
Please sign in to comment.
Something went wrong with that request. Please try again.