mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
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
This commit is contained in:
parent
266a4f4c75
commit
2f09de2e79
1 changed files with 15 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue