================
@@ -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.
----------------
vbvictor wrote:

Design thoughts:
Maybe we can use empty string for diagnostic output?
So people could write:
`clang-tidy --export-sarif` - means to stdout
`clang-tidy --export-sarif=my_file.txt` - means to file.

Using `-` for stdout feels strange to me, could you please explain why you 
chose such design? Any other tools (in LLVM ecosystem particular) use that?

For backing up my approach with empty string we have this example:

```
 --config=<string>                - Specifies a configuration in YAML/JSON 
format:
                                         -config="{Checks: '*',
                                                   CheckOptions: {x: y}}"
                                       When the value is empty, clang-tidy will
                                       attempt to find a file named .clang-tidy 
for
                                       each source file in its parent 
directories.
```

Where empty value means different from heaving a value.

https://github.com/llvm/llvm-project/pull/219182
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to