From d933f2000535277b6c601d9ddbc348c07fda1d4e Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 26 Jan 2011 09:58:16 -0800 Subject: [PATCH] Blanket exclude 'externals/' directory from linting in the PhutilLintEngine. --- scripts/phutil_mapper.php | 11 ++++------- src/lint/engine/phutil/PhutilLintEngine.php | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/phutil_mapper.php b/scripts/phutil_mapper.php index 8dc99436..7edf1133 100755 --- a/scripts/phutil_mapper.php +++ b/scripts/phutil_mapper.php @@ -56,7 +56,7 @@ foreach ($files as $file => $hash) { $modules[Filesystem::readablePath(dirname($file), $root)][] = $hash; } -echo "Found ".count($files)." in ".count($modules)." modules.\n"; +echo "Found ".count($files)." files in ".count($modules)." modules.\n"; $signatures = array(); foreach ($modules as $module => $hashes) { @@ -97,11 +97,6 @@ foreach ($signatures as $module => $signature) { if ($futures) { echo "Found ".count($specs)." modules in cache; ". "analyzing ".count($futures)." modified modules"; -} else { - echo "All modules were found in cache.\n"; -} - -if ($futures) { foreach (Futures($futures)->limit(8) as $module => $future) { echo "."; $specs[$module] = array( @@ -110,6 +105,8 @@ if ($futures) { ); } echo "\n"; +} else { + echo "All modules were found in cache.\n"; } $class_map = array(); @@ -186,7 +183,7 @@ Filesystem::writeFile($root.'/__phutil_library_map__.php', $map_file); echo "Writing module cache...\n"; Filesystem::writeFile( - $root.'/.phutil_module_cache', + $root.'/.phutil_module_cache', json_encode($specs)); echo "Done.\n"; diff --git a/src/lint/engine/phutil/PhutilLintEngine.php b/src/lint/engine/phutil/PhutilLintEngine.php index e345c8f5..6d16e4eb 100644 --- a/src/lint/engine/phutil/PhutilLintEngine.php +++ b/src/lint/engine/phutil/PhutilLintEngine.php @@ -38,6 +38,11 @@ class PhutilLintEngine extends ArcanistLintEngine { if (!$this->pathExists($path)) { unset($paths[$key]); } + if (preg_match('@^externals/@', $path)) { + // Third-party stuff lives in /externals/; don't run lint engines + // against it. + unset($paths[$key]); + } } $generated_linter = new ArcanistGeneratedLinter();