From aabbdbd2ab95b85f12e417f1b612fe8c6175d76a Mon Sep 17 00:00:00 2001 From: Sven Axelsson Date: Wed, 30 Oct 2013 13:46:30 -0700 Subject: [PATCH] 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 --- src/lint/linter/ArcanistCppcheckLinter.php | 3 +++ 1 file changed, 3 insertions(+) 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'); -- 2.43.0