Skip to content

Commit

Permalink
Fix baseline loading for path specified on the command line
Browse files Browse the repository at this point in the history
Fixes #10624
  • Loading branch information
weirdan committed Feb 1, 2024
1 parent 4fdfbac commit 53b14ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Psalm/Internal/Cli/Psalm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,8 @@ private static function initBaseline(
if ($paths_to_check !== null) {
$filtered_issue_baseline = [];
foreach ($paths_to_check as $path_to_check) {
$path_to_check = substr($path_to_check, strlen($config->base_dir));
// +1 to remove the initial slash from $path_to_check
$path_to_check = substr($path_to_check, strlen($config->base_dir) + 1);
if (isset($issue_baseline[$path_to_check])) {
$filtered_issue_baseline[$path_to_check] = $issue_baseline[$path_to_check];
}
Expand Down

0 comments on commit 53b14ce

Please sign in to comment.