Skip to content

Commit

Permalink
Improve source autodiscovery failure message
Browse files Browse the repository at this point in the history
The message we emitted previously did not provide any instructions on
how to resolve the issue, leaving users to guess what they need to do.
  • Loading branch information
weirdan committed Dec 4, 2022
1 parent 4a77f24 commit 45bf0d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Psalm/Config/Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static function getLevel(array $issues, int $counted_types): int
$issues_at_level[$issue_level][$issue_type] = 0;
}

$issues_at_level[$issue_level][$issue_type] += 100/$counted_types;
$issues_at_level[$issue_level][$issue_type] += 100 / $counted_types;
}

foreach ($issues_at_level as $level => $issues) {
Expand Down Expand Up @@ -186,7 +186,10 @@ public static function getPaths(string $current_dir, ?string $suggested_dir): ar

if (!file_exists($composer_json_location)) {
throw new ConfigCreationException(
'Problem during config autodiscovery - could not find composer.json during initialization.'
'Problem during source autodiscovery - could not find composer.json during initialization. '
. 'If your project doesn\'t use Composer autoloader you will need to run '
. '`psalm --init source_folder`, e.g. `psalm --init library` if your source files '
. 'reside in `library` folder'
);
}
try {
Expand Down

0 comments on commit 45bf0d9

Please sign in to comment.