Skip to content
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

Unusable for CI #988

Closed
pretzlaw opened this issue May 4, 2018 · 3 comments
Closed

Unusable for CI #988

pretzlaw opened this issue May 4, 2018 · 3 comments

Comments

@pretzlaw
Copy link

pretzlaw commented May 4, 2018

Summary of a problem or a feature request

Is phpStan unsuable for continous integration?

Code snippet that reproduces the problem

$ 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!

Expected output

0

@PavelJurasek
Copy link
Contributor

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.

@Majkl578
Copy link
Contributor

Majkl578 commented May 4, 2018

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.

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 4, 2018 via email

@lock lock bot locked as resolved and limited conversation to collaborators Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants