1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +01:00

Make caching lint default

Summary: I use it couple of weeks without troubles.

Test Plan:
Added debug output and:

  $ arc lint
  $ arc lint --cache 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2036

Differential Revision: https://secure.phabricator.com/D4242
This commit is contained in:
vrana 2012-12-20 11:35:50 -08:00
parent ffdf44e298
commit 2d63d080df
2 changed files with 6 additions and 5 deletions

View file

@ -372,7 +372,7 @@ EOTEXT
),
'cache' => array(
'param' => 'bool',
'help' => "0 to disable lint cache (default), 1 to enable.",
'help' => "0 to disable lint cache, 1 to enable (default).",
'passthru' => array(
'lint' => true,
),

View file

@ -128,7 +128,7 @@ EOTEXT
),
'cache' => array(
'param' => 'bool',
'help' => "0 to disable cache (default), 1 to enable.",
'help' => "0 to disable cache, 1 to enable (default).",
),
'*' => 'paths',
);
@ -169,6 +169,7 @@ EOTEXT
$rev = $this->getArgument('rev');
$paths = $this->getArgument('paths');
$use_cache = $this->getArgument('cache', true);
if ($rev && $paths) {
throw new ArcanistUsageException("Specify either --rev or paths.");
@ -198,7 +199,7 @@ EOTEXT
$engine->setMinimumSeverity(
$this->getArgument('severity', self::DEFAULT_SEVERITY));
if ($this->getArgument('cache')) {
if ($use_cache) {
$cache = $this->readScratchJSONFile('lint-cache.json');
$cache = idx($cache, $this->getCacheKey(), array());
$cache = array_intersect_key($cache, array_flip($paths));
@ -502,10 +503,10 @@ EOTEXT
$cache = $this->readScratchJSONFile('lint-cache.json');
$cached = idx($cache, $this->getCacheKey(), array());
if ($cached || $this->getArgument('cache')) {
if ($cached || $use_cache) {
foreach ($results as $result) {
$path = $result->getPath();
if (!$this->getArgument('cache')) {
if (!$use_cache) {
unset($cached[$path]);
continue;
}