as_sarif_json is a generic function to cast objects returned by checkglobals,
check_pkg or check_source to SARIF (Static Analysis Results Interchange Format) json
for upload to external CI tools (e.g. GitHub Code Scanning, Jenkins warnings-ng plugin or Azure DevOps).
The function invokes particular methods which depend on the class of the first argument.
Arguments
- x
an S3-object to convert.
- path
file path to write the SARIF json content to.
- pattern
an optional regular expression. Only names matching
patternare returned.glob2rxcan be used to convert wildcard patterns to regular expressions.- which
a character vector, either
"global"to include all unrecognized global variables,"import"to include all detected imported functions and variables, or both (default).- ...
additional arguments to configure the returned output.