-
Notifications
You must be signed in to change notification settings - Fork 472
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
Implement feature 5973 - add SARIF output format #765
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please fix the Windows failures :)
|
||
services: | ||
errorFormatter.sarif: | ||
class: PHPStan\Command\ErrorFormatter\SarifErrorFormatter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in config.neon.
@@ -6,6 +6,7 @@ | |||
], | |||
"require": { | |||
"php": "^7.4 || ^8.0", | |||
"bartlett/sarif-php-sdk": "^1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to do this without a dependency. It's just encoding a simple JSON after all.
{ | ||
$driver = new ToolComponent('PHPStan'); | ||
$driver->setInformationUri('https://phpstan.org'); | ||
$driver->setVersion('1.1.2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version can be obtained like this:
Lines 109 to 114 in 1789915
$version = 'Version unknown'; | |
try { | |
$version = \Jean85\PrettyVersions::getVersion('phpstan/phpstan')->getPrettyVersion() ?: $version; | |
} catch (\OutOfBoundsException $e) { | |
} |
ddd20b4
to
95d480b
Compare
Feel free to open a new PR if you decide to finish this, thanks :) |
As it is my first PR on this project, hope I don't forget any steps.
make cs
OKmake tests
OKMy first remark:
SarifErrorFormatter
and unit tests.Waiting for your feedbacks