1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Switch from --cache-results to --diff-methods flag

This commit is contained in:
Matthew Brown 2018-10-07 00:42:25 -04:00
parent de8dccf6d2
commit afebefba19
5 changed files with 11 additions and 11 deletions

View File

@ -22,6 +22,6 @@ Psalm has a couple of command-line options that will result in faster builds:
- `--threads=[n]` to run Psalms analysis in a number of threads
- `--diff` which only checks files youve updated (and their dependents).
- `--cache-results` which remembers Psalms output when scanning particular methods.
- `--diff-methods` which remembers Psalms output when scanning particular methods.
Running them together (e.g. `--threads=8 --diff --cache-results`) will result in the fastest possible Psalm run.
Running them together (e.g. `--threads=8 --diff --diff-methods`) will result in the fastest possible Psalm run.

View File

@ -138,7 +138,7 @@ class ProjectChecker
/**
* @var bool
*/
public $cache_results = false;
public $diff_methods = false;
/**
* @var bool

View File

@ -277,7 +277,7 @@ class Analyzer
$project_checker->file_reference_provider->setCorrectMethods($this->correct_methods);
$project_checker->file_reference_provider->updateReferenceCache($project_checker->codebase, $scanned_files);
if ($project_checker->cache_results) {
if ($project_checker->diff_methods) {
$project_checker->codebase->statements_provider->resetDiffs();
}
@ -293,7 +293,7 @@ class Analyzer
*/
public function loadCachedResults(ProjectChecker $project_checker)
{
if ($project_checker->cache_results
if ($project_checker->diff_methods
&& !$project_checker->codebase->collect_references
) {
$this->correct_methods = $project_checker->file_reference_provider->getCorrectMethods();

View File

@ -41,7 +41,7 @@ $valid_long_options = [
'threads:',
'use-ini-defaults',
'version',
'cache-results',
'diff-methods',
];
$args = array_slice($argv, 1);
@ -148,8 +148,8 @@ Options:
--diff
Runs Psalm in diff mode, only checking files that have changed (and their dependents)
--cache-results
Cache results of analysis for faster runs
--diff-methods
Only checks methods that have changed (and their dependents)
--output-format=console
Changes the output format. Possible values: console, emacs, json, pylint, xml
@ -414,7 +414,7 @@ $project_checker = new ProjectChecker(
!isset($options['show-snippet']) || $options['show-snippet'] !== "false"
);
$project_checker->cache_results = isset($options['cache-results']);
$project_checker->diff_methods = isset($options['diff-methods']);
$start_time = (float) microtime(true);

View File

@ -62,7 +62,7 @@ class FileUpdateTest extends TestCase
$this->markTestSkipped('Skipped due to a bug.');
}
$this->project_checker->cache_results = true;
$this->project_checker->diff_methods = true;
$codebase = $this->project_checker->getCodebase();
@ -120,7 +120,7 @@ class FileUpdateTest extends TestCase
string $error_message,
array $error_levels = []
) {
$this->project_checker->cache_results = true;
$this->project_checker->diff_methods = true;
$codebase = $this->project_checker->getCodebase();