You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ./tools/psalm --config=.psalm/config.xml
Scanning files...
Analyzing files...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 60 / 322 (18%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 120 / 322 (37%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 180 / 322 (55%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 240 / 322 (74%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 300 / 322 (93%)
░░░░░░░░░░░░░░░░░░░░░░
------------------------------
No errors found!
------------------------------
1085 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 122 of these issues.
Run Psalm again with
--alter --issues=MissingReturnType,UnusedVariable,InvalidReturnType,MissingParamType,PossiblyUnusedMethod,UnusedMethod --dry-run
to see what it can fix.
------------------------------
Checks took 3.19 seconds and used 229.881MB of memory
Psalm was able to infer types for 93.8080% of the codebase
The first problem I run into when upgrading from Psalm 3 to Psalm 4 is that the handling of paths has changed in Psalm's XML configuration file:
$ ./tools/psalm --config=.psalm/config.xml
Problem parsing /usr/local/src/phpunit/.psalm/config.xml:
Could not resolve config path to /usr/local/src/phpunit/.psalm//src
With the changes shown below I am able to run Psalm 4:
$ ./tools/psalm --config=.psalm/config.xml
Scanning files...
Analyzing files...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 60 / 322 (18%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 120 / 322 (37%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 180 / 322 (55%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 240 / 322 (74%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 300 / 322 (93%)
░░░░░░░░░░░░░░░░░░░░░░
ERROR: DocblockTypeContradiction - /usr/local/src/phpunit/src/Framework/Assert.php:110:15 - Docblock-defined type string for $key is always string (see https://psalm.dev/155)
if (!(is_int($key) || is_string($key))) {
.
.
.
------------------------------
1089 errors found
------------------------------
3 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 120 of these issues.
Run Psalm again with
--alter --issues=MissingReturnType,UnusedVariable,InvalidReturnType,MissingParamType,PossiblyUnusedMethod,UnusedMethod --dry-run
to see what it can fix.
------------------------------
Checks took 5.32 seconds and used 155.797MB of memory
Psalm was able to infer types for 92.7308% of the codebase
However, the baseline is ignored.
When I make the changes show below then the baseline is not ignored:
$ ./tools/psalm --config=.psalm/config.xml
Scanning files...
Analyzing files...
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 60 / 322 (18%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 120 / 322 (37%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 180 / 322 (55%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 240 / 322 (74%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 300 / 322 (93%)
░░░░░░░░░░░░░░░░░░░░░░
ERROR: ArgumentTypeCoercion - src/Framework/TestResult.php:683:40 - Argument 1 of SebastianBergmann\CodeCoverage\CodeCoverage::start expects PHPUnit\Framework\TestCase|PHPUnit\Runner\PhptTestCase|string, parent type PHPUnit\Framework\Test provided (see https://psalm.dev/193)
$this->codeCoverage->start($test);
.
.
.
------------------------------
17 errors found
------------------------------
1075 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 120 of these issues.
Run Psalm again with
--alter --issues=MissingReturnType,UnusedVariable,InvalidReturnType,MissingParamType,PossiblyUnusedMethod,UnusedMethod --dry-run
to see what it can fix.
------------------------------
Checks took 5.54 seconds and used 155.598MB of memory
Psalm was able to infer types for 92.7308% of the codebase
As far as I understand it, the two sets of changes to the XML configuration file should be equivalent. Of course, the one which works for me (which is also explained in the release notes for Psalm 4.0.0) is likely the correct one. Still I wonder whether the other should also work and whether that fact that it does not means that there is a bug somewhere.
The text was updated successfully, but these errors were encountered:
muglug
changed the title
Psalm 4.0 ignores baseline
Psalm 4.0 ignores baseline when resolveFromConfigFile="true"
Oct 25, 2020
muglug
changed the title
Psalm 4.0 ignores baseline when resolveFromConfigFile="true"
Psalm 4.0 ignores baseline when resolveFromConfigFile is implicitly "true"
Oct 25, 2020
I have set up Psalm in my projects, for instance for PHPUnit, like so:
.psalm/config.xml
Psalm 3.18
As you can see, this works fine with Psalm 3.18.
Psalm 4.0
The first problem I run into when upgrading from Psalm 3 to Psalm 4 is that the handling of paths has changed in Psalm's XML configuration file:
With the changes shown below I am able to run Psalm 4:
However, the baseline is ignored.
When I make the changes show below then the baseline is not ignored:
As far as I understand it, the two sets of changes to the XML configuration file should be equivalent. Of course, the one which works for me (which is also explained in the release notes for Psalm 4.0.0) is likely the correct one. Still I wonder whether the other should also work and whether that fact that it does not means that there is a bug somewhere.
The text was updated successfully, but these errors were encountered: