-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to skip def_ws prefix in sarif reports
This PR is a suggestion for solving the use case of needing to remove the DEFAULT_WORKSPACE from the out put in the generated SARIF output. (#2006). It moves the SARIF logic to an earlier phase, to be handled before the aggregate SARIF generation. It replaces the prefix if the flag SARIF_REPORTER_NORMALIZE_LINTERS_OUTPUT: true is set (default: true). Implementation is done by line parsing and replacing, as a node traversal solution quickly grew due to the many places in the sarif out put the uri can be found (metris, relatedLocations, and so on), and the code is much simpler this way to maintain. Improvements and suggestions: Could dumps and resulting json string be used in a reliable way to line parse an json file? I didn't find a good way. Should the option be renamed to SARIF_REPORTER_DISABLE_DEFAULT_WORKSPACE_IN_OUTPUT or alike. As the pre existing normalization still happens? (We don't change that pre existing behaviour in this PR, only the DEFAULT_WORKSPACE prefix part). Signed-off-by: Josef Andersson <josef.andersson@gmail.com>
- Loading branch information
1 parent
4363d26
commit 94130ea
Showing
4 changed files
with
272 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.