@@ -86,30 +86,11 @@ development processes.
8686
8787## Getting Started
8888
89- ### Enabling SARIF logs
89+ ### Using SARIF logs
9090
91- SquiggleCop uses [ SARIF] ( https://sarifweb.azurewebsites.net/ ) v2.1 files to work its magic. If you aren't already
92- producing SARIF files as part of your build, set the
93- [ ` ErrorLog ` ] ( https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#errorlog )
94- property, either in a
95- [ Directory.Build.props] ( https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=vs-2022 )
96- so it automatically applies to all projects:
97-
98- ``` xml
99- <ErrorLog >$(MSBuildProjectFile).diagnostics.sarif,version=2.1</ErrorLog >
100- ```
101-
102- > [ !TIP]
103- > We recommend you add ` *.sarif ` to your ` .gitignore ` file
104-
105- or on the command-line for ad-hoc validation:
106-
107- ``` powershell
108- dotnet build -p:ErrorLog=diagnostics.sarif%2cversion=2.1
109- ```
110-
111- > [ !IMPORTANT]
112- > The comma or semi-colon character in the log path must be XML-escaped
91+ SquiggleCop uses [ SARIF] ( https://sarifweb.azurewebsites.net/ ) v2.1 files to work its magic. SquiggleCop automatically
92+ enables SARIF logs if needed and places them in the ` obj/ ` folder. If you want / need to customize the SARIF output
93+ path, see [ Set the SARIF output path] ( #set-the-sarif-output-path ) .
11394
11495### CLI Tool
11596
@@ -285,6 +266,28 @@ Upload your SARIF reports as pipeline artifacts to help narrow down issues.
285266
286267# # Advanced configuration
287268
269+ # ## Set the SARIF output path
270+
271+ If the [`ErrorLog`](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#errorlog)
272+ property is unset, SquiggleCop sets it just before the `CoreCompile` target. To set a custom SARIF output path, set the
273+ property to something like this :
274+
275+ ` ` ` xml
276+ <ErrorLog>$(MSBuildProjectFile).sarif,version=2.1</ErrorLog>
277+ ` ` `
278+
279+ > [!TIP]
280+ > We recommend you add `*.sarif` to your `.gitignore` file
281+
282+ or set the property on the command-line as part of ad-hoc validation :
283+
284+ ` ` ` powershell
285+ dotnet build -p:ErrorLog=diagnostics.sarif%2cversion=2.1
286+ ` ` `
287+
288+ > [!IMPORTANT]
289+ > The comma or semi-colon character in the log path must be XML-escaped
290+
288291# ## Alternate baseline paths
289292
290293By default, SquiggleCop expects the baseline file to be named `SquiggleCop.Baseline.yaml` and placed next to the project
0 commit comments