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

Add more text feedback when running from command line

This commit is contained in:
Matthew Brown 2018-02-04 15:27:03 -05:00
parent 8747d78c39
commit beb4993736
2 changed files with 29 additions and 20 deletions

View File

@ -82,11 +82,6 @@ class ProjectChecker
*/
public $alter_code = false;
/**
* @var bool
*/
public $server_mode = false;
/** @var int */
public $threads;
@ -257,16 +252,16 @@ class ProjectChecker
}
}
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Scanning files...' . PHP_EOL;
}
if ($diff_files === null || $deleted_files === null || count($diff_files) > 200) {
foreach ($this->config->getProjectDirectories() as $dir_name) {
$this->checkDirWithConfig($dir_name, $this->config);
}
$this->codebase->scanFiles();
if (!$this->server_mode) {
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
}
} else {
if ($this->debug_output) {
echo count($diff_files) . ' changed files' . PHP_EOL;
@ -280,12 +275,14 @@ class ProjectChecker
$this->checkDiffFilesWithConfig($this->config, $file_list);
$this->codebase->scanFiles();
if (!$this->server_mode) {
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
}
}
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Analyzing files...' . PHP_EOL;
}
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
$removed_parser_files = $this->cache_provider->deleteOldParserCaches(
$is_diff ? $this->cache_provider->getLastGoodRun() : $start_checks
);
@ -361,7 +358,16 @@ class ProjectChecker
$this->checkDirWithConfig($dir_name, $this->config, true);
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Scanning files...' . PHP_EOL;
}
$this->codebase->scanFiles();
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Analyzing files...' . PHP_EOL;
}
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
}
@ -513,7 +519,16 @@ class ProjectChecker
FileReferenceProvider::loadReferenceCache();
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Scanning files...' . PHP_EOL;
}
$this->codebase->scanFiles();
if ($this->output_format === self::TYPE_CONSOLE) {
echo 'Analyzing files...' . PHP_EOL;
}
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->alter_code);
}

View File

@ -247,13 +247,7 @@ class IssueBuffer
if ($is_full) {
echo 'Psalm was able to infer types for ' . number_format($nonmixed_percentage, 3) . '%'
. ' of the codebase';
if (!$add_stats) {
echo ' - get a breakdown by running Psalm with --stats';
}
echo PHP_EOL;
. ' of the codebase' . PHP_EOL;
}
if ($add_stats) {