From: vrana Date: Tue, 26 Feb 2013 23:20:13 +0000 (-0800) Subject: Include linter class MD5 in linter version X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2f09de2e798ee7b64c65af06e90d330b75a1cb3e;p=arcanist.git Include linter class MD5 in linter version Summary: People constantly forget to bump the linter version and I don't see a way how to stop it. This may bump the version even if it wouldn't be required but let's rather undercache than overcache. Test Plan: `var_dump($version)`. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5129 --- diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index f3bb44bd..6076d3e6 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -185,10 +185,24 @@ abstract class ArcanistLintEngine { } $versions = array($this->getCacheVersion()); + foreach ($linters as $linter) { $linter->setEngine($this); - $versions[] = get_class($linter).':'.$linter->getCacheVersion(); + $version = get_class($linter).':'.$linter->getCacheVersion(); + + $symbols = id(new PhutilSymbolLoader()) + ->setType('class') + ->setName(get_class($linter)) + ->selectSymbolsWithoutLoading(); + $symbol = idx($symbols, 'class$'.get_class($linter)); + if ($symbol) { + $version .= ':'.md5_file( + phutil_get_library_root($symbol['library']).'/'.$symbol['where']); + } + + $versions[] = $version; } + $this->cacheVersion = crc32(implode("\n", $versions)); $this->stopped = array();