1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Ignore recently-deleted files for scanning

This commit is contained in:
Matthew Brown 2021-01-04 19:00:44 +00:00 committed by Daniil Gentili
parent e949ed68ac
commit 0e1ef2e096
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -530,7 +530,7 @@ class Scanner
string $file_path,
array $filetype_scanners,
bool $will_analyze = false
): FileScanner {
): void {
$file_scanner = $this->getScannerForPath($file_path, $filetype_scanners, $will_analyze);
if (isset($this->scanned_files[$file_path])
@ -539,6 +539,11 @@ class Scanner
throw new \UnexpectedValueException('Should not be rescanning ' . $file_path);
}
if (!$this->file_provider->fileExists($file_path) && $this->config->mustBeIgnored($file_path)) {
// this should not happen, but might if the file was temporary
return;
}
$file_contents = $this->file_provider->getContents($file_path);
$from_cache = $this->file_storage_provider->has($file_path, $file_contents);
@ -610,8 +615,6 @@ class Scanner
$this->codebase->classlikes->addClassAlias($unaliased_name, $aliased_name);
}
}
return $file_scanner;
}
/**