tav/nodelint — Issue #27: large output gets truncated on xml reporter
Author: pmlopes
Created: 2011-11-03 11:48:18+00:00
State: open

I've a very large project and when i run the xml reporter i get truncated output, i hacked it by modifying the xml reporter to write to a file and that solves it for me, but i think it should be fixed, here is my modified xml.js:

// example usage:
//
// $ nodelint path/to/file.js --reporter examples/reporters/xml.js
//
// this reporter produces jslint xml that can be automatically recognised by
// Hudson Violations Plugin http://wiki.hudson-ci.org/display/HUDSON/Violations+Plugin

var path = require('path'),
fs = require('fs');

function reporter(results) {

function escape(str) {
return (str) ? str.replace(//g, '>').replace(/"/g, '"') : '';
}

var i, error, len, file,
dir = process.cwd(),
xml = '\n\n';

for (i = 0, len = results.length; i < len; i += 1) {
file = path.join(dir, results[i].file);
error = results[i].error;
xml += '\t\n' +
'\t\t\n' +
'\t\n';
}

xml += '';
var outputFile = process.env.NODELINT_OUT;
if(outputFile) {
fs.writeFileSync(outputFile, xml + '\n');
} else {
console.log(xml);
}
}