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

Do not change baseline when checking specific files

This commit is contained in:
Bruce Weirdan 2023-08-21 09:25:37 +02:00
parent 670bd6afce
commit 0a9e647603
No known key found for this signature in database
GPG Key ID: CFC3AAB181751B0D

View File

@ -1049,6 +1049,10 @@ final class Psalm
$issue_baseline = []; $issue_baseline = [];
if (isset($options['set-baseline']) && is_string($options['set-baseline'])) { if (isset($options['set-baseline']) && is_string($options['set-baseline'])) {
if ($paths_to_check !== null) {
fwrite(STDERR, PHP_EOL . 'Cannot generate baseline when checking specific files' . PHP_EOL);
exit(1);
}
$issue_baseline = self::generateBaseline($options, $config, $current_dir, $path_to_config); $issue_baseline = self::generateBaseline($options, $config, $current_dir, $path_to_config);
} }
@ -1065,6 +1069,10 @@ final class Psalm
} }
if (isset($options['update-baseline'])) { if (isset($options['update-baseline'])) {
if ($paths_to_check !== null) {
fwrite(STDERR, PHP_EOL . 'Cannot update baseline when checking specific files' . PHP_EOL);
exit(1);
}
$issue_baseline = self::updateBaseline($options, $config); $issue_baseline = self::updateBaseline($options, $config);
} }