-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Psalm errorBaseline config not respected when given paths #10624
Labels
Comments
Sample of our psalm baseline and psalm config if that's needed but I think it's clear already. Latest baseline: <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.21.0@04ba9358e3f7d14a9dc3edd4e814a9d51d8c637f">
<file src="admin-scripts/test-user/configure-test-users.php">
<InvalidCast>
<code>$currencyId</code>
<code>$field</code>
<code>$field</code>
<code>$field</code>
<code>$key</code> Previous baseline (no change): <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.19.0@06b71be009a6bd6d81b9811855d6629b9fe90e1b">
<file src="admin-scripts/test-user/configure-test-users.php">
<InvalidCast>
<code>$currencyId</code>
<code>$field</code>
<code>$field</code>
<code>$field</code>
<code>$key</code> <?xml version="1.0"?>
<psalm
autoloader="public/lib/common.php"
errorBaseline="psalm-baseline.xml"
errorLevel="1"
findUnusedBaselineEntry="false"
findUnusedCode="true"
phpVersion="8.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<plugins>
<pluginClass class="Psalm\FreelancerPsalmPlugin\Plugin"/>
<pluginClass class="Psalm\MockeryPlugin\Plugin"/>
<pluginClass class="CuyZ\Valinor\QA\Psalm\ValinorPsalmPlugin"/>
</plugins>
<projectFiles>
<!-- Included paths... everything! -->
<directory name="."/>
<ignoreFiles allowMissingFiles="true">
<!-- External -->
<directory name="vendor"/> |
gready-hub
changed the title
Psalm errorBaseline config not respected
Psalm errorBaseline config not respected when given paths
Jan 31, 2024
To clarify: $path_to_check = '/a/b/c.php';
$config->base_dir = '/a/b';
$baseline_path = 'c.php'; // but checked against /c.php Is that the correct problem description? |
Looks correct to me. FYI I'm running a composer patch successfully with a similar fix from the issue summary with 5.21.0, works when specifying file paths & without. |
tyvm! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there. I've found this to break how the error baseline is used. Due to the removal of the trailing
/
from the config path Psalm does not locate the files from the error baseline due too this one missing character.Either the generate baseline needs to add the prefix or we need to remove the prefix
/
when checking if the path is in the$issues_baseline
map.From
src/Psalm/Internal/Cli/Psalm.php
This resolves the issue I have been experiencing... Either increment by one or remove prefix
/
prior.Originally posted by @gready-hub in #10542 (comment)
The text was updated successfully, but these errors were encountered: