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

Output more clear errors #49

Closed
taoso opened this issue Dec 26, 2016 · 6 comments
Closed

Output more clear errors #49

taoso opened this issue Dec 26, 2016 · 6 comments

Comments

@taoso
Copy link
Contributor

taoso commented Dec 26, 2016

The phpstan output is like bellow

 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------
  Line   src/Foo.php            
 ------ ------------------------
  9      Undefined variable: $a
 ------ ------------------------

                                                                                                                        
 [ERROR] Found 1 error                                                                                                  
                                                                                                                        

which is awesome for human but ugly for cli app reading from pipe. It's hard to use the phpstan's result for other app like vim-syntastic.

So, I promise to add an new option the make the result output like

src/Foo.php:9  Undefined variable: $a
src/Bar.php:9  Undefined variable: $a
@ondrejmirtes
Copy link
Member

I'd rather add some machine-readable format like JSON or XML :)

@taoso taoso closed this as completed Dec 26, 2016
@greg0ire
Copy link

greg0ire commented Feb 3, 2017

@ondrejmirtes please reconsider, see how it's done for phpcs, for instance : https://github.com/vim-syntastic/syntastic/blob/master/syntax_checkers/php/phpcs.vim#L24
Performance-wise, I think it's better to avoid serialization AND deserialization
The name of the option could be porcelain, like in git status.

@ondrejmirtes
Copy link
Member

@greg0ire I want to add support for custom formatters which will allow this :)

@greg0ire
Copy link

greg0ire commented Feb 3, 2017

Glad to hear that!

@codeinabox
Copy link

Great. I am a trying to add support in Neomake neomake/neomake#1026 and the author asked the same question

@ondrejmirtes
Copy link
Member

@greg0ire @codeinabox @lvht Support for custom errors formatters was added in #185.

@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