1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-26 23:40:56 +01:00

get jshint error codes

Summary:
makes jshint slightly more useful by printing out error numbers. I love memorizing numbers.
Sorry about the crappy getLintMessageName(). There was no list of error names, just the long descriptions that are already rendered as 'reason'.

Test Plan: Verify that the numbers are mezmorizing. Been tested on OSX with jshint v2.1.11

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D7213
This commit is contained in:
Tal Shiri 2013-10-04 06:29:47 -07:00 committed by epriestley
parent 587addfd94
commit 4e892e7269
2 changed files with 12 additions and 6 deletions

View file

@ -54,6 +54,12 @@ final class ArcanistJSHintLinter extends ArcanistLinter {
);
}
// placeholder if/until we get a map code -> name map
// jshint only offers code -> description right now (parsed as 'reason')
public function getLintMessageName($code) {
return "JSHint".$code;
}
public function getLintNameMap() {
return array(
self::JSHINT_ERROR => "JSHint Error"
@ -163,7 +169,7 @@ final class ArcanistJSHintLinter extends ArcanistLinter {
$this->raiseLintAtLine(
$err->line,
$err->col,
self::JSHINT_ERROR,
$err->code,
$err->reason);
}
}

View file

@ -4,12 +4,12 @@ module.exports = {
results.forEach(function (result) {
var error = result.error;
report.push({
'file': result.file,
'line': error.line,
'col': error.character,
'reason': error.reason
'file' : result.file,
'line' : error.line,
'col' : error.character,
'reason': error.reason,
'code' : error.code,
});
});