InspectCode output analysis #4428
pascalberger
started this conversation in
General
Replies: 1 comment
-
Suggestion sounds good to me 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starting from version 2024.1, the default output format of InspectCode is Static Analysis Results Interchange Format (SARIF). The XML format, which was the default in previous versions, will soon be deprecated and currently requires manually setting the
-f="xml"
parameter which is not part of the settings class.See https://www.jetbrains.com/help/resharper/InspectCode.html for details.
By default the
InspectCode
alias runs some analysis if an output file is defined. This no longer works with InspectCode >= 2024.1, where the default format is SARIF.My suggestions going forward:
Introduce possibility to define format
Introduce a new
InspectCodeSettings.Format
setting of typeInspectCodeFormat[]
, with possible valuesInspectCodeFormat.Html
,InspectCodeFormat.Text
andInspectCodeFormat.Xml
. Default value would be nothave the setting set, resulting in SARIF format being created (no
-f
passed)Introduce new
Output
parameterWhen multiple output formats are specified an output directory path instead of a file path can be passed.
For this we can introduce a new
InspectCodeSettings.OutputDirectory
parameter of typeDirectoryPath
which also sets the--output
parameter.A check should be added to throw an exception in case
InspectCodeSettings.OutputFile
andInspectCodeSettings.OutputDirectory
are setRun analysis only for XML format
Change code in InspectCode runner to run
AnalyseResultsFile
only in case XML format is created and only on XML file.Deprecate analysis
With the announcement that XML output will be deprecated and with Cake.Issues addin a solution available to parse and process either XML or SARIF output from InspectCode we can remove the code from Cake.Common in next major version. First step would be to deprecate
InspectCodeSettings.ThrowExceptionOnFindingViolations
andInspectCodeSettings.SkipOutputAnalysis
with a link to Cake.Issues addin.Beta Was this translation helpful? Give feedback.
All reactions