Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented May 8, 2023

allows to configure the message severity when formatting phpstan-errors in the GithubErrorFormatter.

Our use case:
we want to run 2 phpstan jobs in parallel.

  • one with our currently supported php version
  • another job where we use our future php version (the one we are aiming for to support within the next few months)

we don't want to allow new errors in the currently supported php version. additionally we want github action to report only warnings for the future php version, as not all members of the team are working on that topic.

as soon as we have fixed all future php version problems we will raise the error level in the pipeline for the future php version

-> long story short: would be cool we could configure the message severity of errors reported by the phpstan github formatter

effectivly this will make the errors on the github.com ui yellow instead of red - example (not using phpstan):

grafik

@ondrejmirtes
Copy link
Member

Hello, this is a very limited use-case that I'm not willing to support and maintain in PHPStan.

You can already do this on your side, in multiple ways:

  1. Pipe the PHPStan output into your own script that will make the output "yellow".
  2. Write your own error formatter that will do this. You can even decorate the original formatter and make your code DRY.

@staabm staabm deleted the github-error-levels branch May 8, 2023 15:30
@staabm
Copy link
Contributor Author

staabm commented May 8, 2023

I see. Instead I have adjusted cs2pr so I can downgrade errors to warnings in staabm/annotate-pull-request-from-checkstyle#112

that way I can utilize the checkstyle error format and leave the rest to cs2pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants