]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Filter out messages from included files
authorSven Axelsson <sven@axelsson.name>
Wed, 30 Oct 2013 20:46:30 +0000 (13:46 -0700)
committerepriestley <git@epriestley.com>
Wed, 30 Oct 2013 20:46:30 +0000 (13:46 -0700)
Summary:
CppCheck shows lint messages from included files as well as the current
file. Filter out those, since they don't make much sense in the context
of `arc lint`.

Test Plan:
Before this patch, `arc lint` using `ArcanistCppcheckLinter`. Note that lint messages
from included files appear pointing to a line in the active file.
After this patch, only messages from the active file are included.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran
Differential Revision: https://secure.phabricator.com/D7444

src/lint/linter/ArcanistCppcheckLinter.php

index 2f529a3ae9f139f76b7b194d737cfd9c3e93b79a..33b9f490733855585c0b8c10fc16260821c772b2 100644 (file)
@@ -96,6 +96,9 @@ final class ArcanistCppcheckLinter extends ArcanistLinter {
         continue;
       }
       $file = $location->getAttribute('file');
+      if ($file != Filesystem::resolvePath($path)) {
+        continue;
+      }
       $line = $location->getAttribute('line');
 
       $id = $error->getAttribute('id');