microsoft / sarif-sdk

.NET code and supporting files for working with the 'Static Analysis Results Interchange Format' (SARIF, see https://github.com/oasis-tcs/sarif-spec)
Other
191 stars 90 forks source link

Supress can't remove empty results from Sarif json file? #2651

Open calicoder77 opened 1 year ago

calicoder77 commented 1 year ago

Good day, I currently have a SARIF 1.0 file which includes warnings, errors and empty results. I see that the suppress mode allows removal of results. I've tried using the --remove "results: []" command-line argument but keep getting an errorOption remove is defined with a bad format. Is there a way to do this? If there is I can open a request to have themultitool` doc example add how to do it as I'm sure I'm not the only one that needs this feature.

Thanks

shaopeng-gh commented 1 year ago

Hello, actually the usage of the --remove is limited to below, (you may not see the same help text in the tool, we just updated)

[Option(
            "remove",
            Separator = ';',
            HelpText =
            "Optionally present data, expressed as a semicolon-delimited list (escape semicolon with backslash in Unix-like OS), " +
            "that should be not be persisted to or which should be removed from the log file. Valid values include Hashes, TextFiles, " +
            "BinaryFiles, EnvironmentVariables, RegionSnippets, ContextRegionSnippets, Guids, VersionControlDetails, and NondeterministicProperties.")]

e.g. if you have Hashes in the semicolon-delimited list, I would expect below removed

"hashes": {
            "md5": "6AE56F109CB2FC5A3FAB039C21CB9298",
            "sha-1": "ADA174BDF6654D85507ADAA80F333F9EBDE1F221",
            "sha-256": "D9933BFE1FF014C5AD2C6F84465ADD174DEE31326737B29B5DD26ACA701E0948"
          }