Is phpStan unsuable for continous integration?
$ vendor/bin/phpstan analyse -l 1 -c phpstan.neon src
85/85 [ββββββββββββββββββββββββββββ] 100%
---------------------------------------------------------------------------------------------------------------------------
Error
---------------------------------------------------------------------------------------------------------------------------
Ignored error pattern #Access to an undefined property object::\$[\w]+.# was not matched in reported errors.
---------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 1 error
www-data@13da5ca8cbd4:~/www$ echo $?
1
Really? Having no error is an error. Cool!
0
Wait, what?
https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
0 means that the program passed, non-zero exit code means an error, so your snippet behaves correctly.
There is no error, just superfluous ignoreErrors pattern (which could be for multiple reasons).
I agree non-zero exit code in this case is wrong.
You can set reportUnmatchedIgnoredErrors
to false to ignore this and exit code will be 0. But itβs not the default
so you can find out that something does no longer have to be ingnored, or
that you can ponder why the error does no longer show up.
The current behaviour is by design.
n Fri, 4 May 2018 at 17:54, Michael Moravec notifications@github.com
wrote:
There is no error, just superfluous ignoreErrors pattern (which could be
for multiple reasons).
I agree non-zero exit code in this case is wrong.β
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/phpstan/phpstan/issues/988#issuecomment-386644959,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGZuOK9AAk-koDY8R9uYuKnFFBBcn1Eks5tvHmogaJpZM4Ty2qH
.>
OndΕej Mirtes
Most helpful comment
You can set reportUnmatchedIgnoredErrors
to false to ignore this and exit code will be 0. But itβs not the default
so you can find out that something does no longer have to be ingnored, or
that you can ponder why the error does no longer show up.
The current behaviour is by design.
n Fri, 4 May 2018 at 17:54, Michael Moravec notifications@github.com
wrote:
OndΕej Mirtes