[clang] [clang-tools-extra] [clang-tidy] Add SARIF output to clang-tidy (PR #219182)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 00:36:14 PST 2026


================
@@ -192,6 +192,9 @@ An overview of all the command-line options:
     --export-fixes=<filename>        - YAML file to store suggested fixes in. The
                                        stored fixes can be applied to the input source
                                        code with clang-apply-replacements.
+    --sarif-export=<filename>        - File in which to store diagnostics in SARIF format.
+                                       Use '-' to write to stdout instead of the usual
+                                       diagnostic output.
----------------
t-a-james wrote:

That's originally what we had, but I asked for it to be changed.  We're going to end up with a few flags for sarif (`sarif-export` now, `sarif-base-uri` in https://github.com/llvm/llvm-project/pull/235711 , and probably a few more later), and I thought it was nice to have them grouped together under `--sarif-*`.

I'd also guess that once SARIF supports fixits, `--export-fixes` and `--sarif-export` might be mutually exclusive...?  I haven't thought that one through properly.

No strong feelings either way :)

https://github.com/llvm/llvm-project/pull/219182


More information about the cfe-commits mailing list