Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Sep 7, 2023

as described in phpstan/phpstan#9857 (comment)

use with

php bin/phpstan analyze --error-format=failWithoutResultCache -vvv 

tested with

$ php bin/phpstan clear-result-cache Note: Using configuration file C:\dvl\Workspace\phpstan-src-staabm\phpstan.neon.dist. Result cache cleared from directory: C:\dvl\Workspace\phpstan-src-staabm/tmp mstaab@NB-COMPLEX-61 MINGW64 /c/dvl/Workspace/phpstan-src-staabm (err-formatter) $ php bin/phpstan analyze --error-format=failWithoutResultCache -vvv Note: Using configuration file C:\dvl\Workspace\phpstan-src-staabm\phpstan.neon.dist. Result cache not used because the cache file does not exist. 1563/1563 [============================] 100% 36 secs/36 secs Result cache is saved. Used memory: 3.63 GB mstaab@NB-COMPLEX-61 MINGW64 /c/dvl/Workspace/phpstan-src-staabm (err-formatter) $ echo $? 2 mstaab@NB-COMPLEX-61 MINGW64 /c/dvl/Workspace/phpstan-src-staabm (err-formatter) $ php bin/phpstan analyze --error-format=failWithoutResultCache -vvv Note: Using configuration file C:\dvl\Workspace\phpstan-src-staabm\phpstan.neon.dist. 1563/1563 [============================] 100% < 1 sec/< 1 sec Result cache is saved. [OK] No errors Used memory: 130 MB mstaab@NB-COMPLEX-61 MINGW64 /c/dvl/Workspace/phpstan-src-staabm (err-formatter) $ echo $? 0 
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to differentiate a error caused by non-existant result cache, I figured I would use a separate code from 0/1 which the other formatters use

@staabm staabm marked this pull request as ready for review September 7, 2023 15:35
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

Perfect, thank you!

@ondrejmirtes ondrejmirtes merged commit 2d926f0 into phpstan:1.10.x Sep 7, 2023
@staabm staabm deleted the err-formatter branch September 7, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants