1 /*jslint forin: true */
3 var color = require("./color");
6 exports.report = function (file, lint, colorize) {
9 var options = [], key, value, line,
10 i, len, pad, e, fileMessage;
12 for (key in lint.options) {
13 value = lint.options[key];
14 options.push(key + ": " + value);
17 fileMessage = "\n" + ((colorize) ? color.bold(file) : file);
21 len = lint.errors.length;
22 for (i = 0; i < len; i += 1) {
23 pad = "#" + String(i + 1);
24 while (pad.length < 3) {
29 line = ' // Line ' + e.line + ', Pos ' + e.character;
31 log(pad + ' ' + ((colorize) ? color.yellow(e.reason) : e.reason));
32 log(' ' + (e.evidence || '').replace(/^\s+|\s+$/, "") +
33 ((colorize) ? color.grey(line) : line));
37 log(fileMessage + " is " + ((colorize) ? color.green('OK') : 'OK') + ".");