Skip to content

Add SARIF renderer#865

Merged
kylekatarnls merged 6 commits into
phpmd:masterfrom
lukasbestle:feature/sarif-renderer
Apr 16, 2021
Merged

Add SARIF renderer#865
kylekatarnls merged 6 commits into
phpmd:masterfrom
lukasbestle:feature/sarif-renderer

Conversation

@lukasbestle

@lukasbestle lukasbestle commented Jan 12, 2021

Copy link
Copy Markdown
Contributor

Type: feature
Issue: Fix #858
Breaking change: no

About this PR

SARIF, the Static Analysis Results Interchange Format, is a standard, JSON-based format for the output of static analysis tools.

As it is an approved OASIS standard, many other tools already support it, including other analyzers and also visualizers (for example IDEs or GitHub Actions). SARIF support in PHPMD will therefore make it much more interoperable with other tools and workflows.

Example use-case

GitHub can display the SARIF output in a rich UI with help texts and examples.

You can see this PR in action in this quick and dirty example workflow run:


Please check this points before submitting your PR.

  • Add test to cover the changes you made on the code.
  • If you add a new feature please update the documentation in the same PR. (The site docs will be updated in Docs for the GitHub renderer #861 once this PR is approved/merged to avoid merge-conflicts.)

This makes the raw arguments accessible from renderers for localization etc. Backwards-compatibility inside the `RuleViolation` class is kept as a single string is still supported.
@kylekatarnls kylekatarnls self-requested a review January 12, 2021 11:58
@lukasbestle

Copy link
Copy Markdown
Contributor Author

@kylekatarnls Have you been able to take a look at this so far? Is there anything I can do to make reviewing easier for you?

@kylekatarnls kylekatarnls added this to the 2.10.0 milestone Apr 16, 2021
kylekatarnls
kylekatarnls previously approved these changes Apr 16, 2021
@kylekatarnls kylekatarnls merged commit c826a7c into phpmd:master Apr 16, 2021
@lukasbestle lukasbestle deleted the feature/sarif-renderer branch April 17, 2021 08:30
@kylekatarnls kylekatarnls mentioned this pull request Apr 17, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add SARIF renderer

2 participants