]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't use error context from JSHint in linter messages
authorJoshua Spence <josh@joshuaspence.com>
Mon, 23 Jun 2014 00:33:01 +0000 (10:33 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 23 Jun 2014 00:33:01 +0000 (10:33 +1000)
Summary:
The error context (a.k.a. "original text") as provided by `jshint` is not very useful and actually causes `arc lint` to display the lint message incorrectly.

{F169277}

The underlying problem here is that the error context from `jshint` contains the entire line from the input file rather than just the offending source code.

Test Plan: Ran `arc lint -- webroot/rsrc/js/core/behavior-hovercard.js` (in rP) and verified that the output looked reasonable.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9675

src/lint/linter/ArcanistJSHintLinter.php
src/lint/linter/reporter.js

index a3b4915536848d48f1974577c34b75dd7f4af62e..ea286bc16120d95f620d5224f29530323b67c35e 100644 (file)
@@ -157,7 +157,6 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter {
       $message->setName('JSHint'.idx($err, 'code'));
       $message->setDescription(idx($err, 'reason'));
       $message->setSeverity($this->getLintMessageSeverity(idx($err, 'code')));
-      $message->setOriginalText(idx($err, 'evidence'));
 
       $messages[] = $message;
     }
index 42d0d07b82dd1e015d0f1cf52da315d433b32890..d66c6cdc7711070ad23c0578480217f8c0f23c2e 100644 (file)
@@ -10,7 +10,6 @@ module.exports = {
         'col'     : error.character,
         'reason'  : error.reason,
         'code'    : error.code,
-        'evidence': error.evidence,
       });
     });