536190696445fa4e46f13b6b8280c9e6b9483a32.svn-base
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*jshint node: true */
module.exports =
{
reporter: function (results, data) {
var len = results.length,
str = '',
file, error, globals, unuseds;
results.forEach(function (result) {
file = result.file;
error = result.error;
str += file + ': line ' + error.line + ', col ' +
error.character + ', ' + error.reason + '\n';
});
str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : "";
data.forEach(function (data) {
file = data.file;
globals = data.implieds;
unuseds = data.unused;
if (globals || unuseds) {
str += '\n\n' + file + ' :\n';
}
if (globals) {
str += '\tImplied globals:\n';
globals.forEach(function (global) {
str += '\t\t' + global.name + ': ' + global.line + '\n';
});
}
if (unuseds) {
str += '\tUnused Variables:\n\t\t';
unuseds.forEach(function (unused) {
str += unused.name + '(' + unused.line + '), ';
});
}
});
if (str) {
process.stdout.write(str + "\n");
}
}
};