From: Sven Axelsson Date: Wed, 30 Oct 2013 20:46:30 +0000 (-0700) Subject: Filter out messages from included files X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=aabbdbd2ab95b85f12e417f1b612fe8c6175d76a;p=arcanist.git Filter out messages from included files 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 --- diff --git a/src/lint/linter/ArcanistCppcheckLinter.php b/src/lint/linter/ArcanistCppcheckLinter.php index 2f529a3a..33b9f490 100644 --- a/src/lint/linter/ArcanistCppcheckLinter.php +++ b/src/lint/linter/ArcanistCppcheckLinter.php @@ -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');