0

I'm here with the one of the weirdest questions in my life. Suddenly psalm stopped seeing any errors in my code. I was fixing some issues, and then all of a sudden I stopped getting errors from psalm. I know there are many of them, because I used to ignore some of them within psalm.xml. Now I rolled back to master (stable code), and removed all exceptions from the config. Still nothing.

psalm.xml:

<?xml version="1.0"?>
<psalm
    errorLevel="1"
    resolveFromConfigFile="true"
    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"
>
    <projectFiles>
        <directory name="src/" />
        <ignoreFiles>
            <directory name="vendor" />
        </ignoreFiles>
    </projectFiles>
    <issueHandlers>
        <MixedPropertyTypeCoercion>
            <errorLevel type="suppress">
                <file name="src/Transport/Message/Params/SendMessageParams.php"/>
            </errorLevel>
        </MixedPropertyTypeCoercion>
    </issueHandlers>
    <stubs><file name="./config/bootstrap.php" /></stubs>
</psalm>

Note, I removed about 20 entries from issueHandlers which would trigger errors (just to test if psalm working).

Command: sudo -u wwwbm -E -H /usr/bin/php -d memory_limit=2048M vendor/bin/psalm

Output:

Scanning files...
Analyzing files...

░
------------------------------
No errors found!
------------------------------

Checks took 2.14 seconds and used 217.018MB of memory
Psalm was unable to infer types in the codebase

I'm stuck. I'm not even sure at which moment it stopped showing errors, just in the middle of coding actually.

I know the question is too broad now, so I'll try to make it a little bit more strict:

Is there any way to debug psalm? Any kind of verbose mode, or maybe any internal debugging system exists for the lib? I'm literally going crazy.

Psalm version: 3.18.2

ozahorulia
  • 9,798
  • 8
  • 48
  • 72
  • 1
    are there any other psalm specific files in your projectdirs ? (such things can be in .gitignore which could explain why your rollback had no effect). If you use psalm from your IDE then i'd also have a peek in your IDE's configfile (settings.json for VS code for example). I can imagine accidentally hitting some keybind (or misclicking) and triggering an 'ignore all these errors'-type-a-scenario. Pure speculation of course, but maybe you hadn't thought of it yet, it's worth seeing whats in there. – Raxi Dec 31 '21 at 02:32
  • 1
    There are `--debug` and `--debug-by-line` switches that may provide you with some insight. – weirdan Dec 31 '21 at 03:10
  • 1
    But also your Psalm version is really, really old. – weirdan Dec 31 '21 at 03:12
  • @weirdan agreed. I just updated to 4.x and it works now without any code changes. Still don't know what was it. – ozahorulia Dec 31 '21 at 03:13

0 Answers0