Skip to content

Commit

Permalink
Add SquiggleCop
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKotsenas committed Jul 29, 2024
1 parent a883a67 commit dcd925d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/targets/codeanalysis/CodeAnalysis.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SquiggleCop.Tasks">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
17 changes: 17 additions & 0 deletions build/targets/codeanalysis/CodeAnalysis.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,22 @@
<PedanticMode Condition=" '$(PedanticMode)' == '' ">$([MSBuild]::ValueOrDefault('$(ContinuousIntegrationBuild)', 'false'))</PedanticMode>
<TreatWarningsAsErrors>$(PedanticMode)</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>$(PedanticMode)</MSBuildTreatWarningsAsErrors>
<SquiggleCop_Enabled>$(PedanticMode)</SquiggleCop_Enabled>
</PropertyGroup>

<Target Name="SetErrorLog" BeforeTargets="CoreCompile">
<!--
ErrorLog is needed for SquiggleCop.
The value is set in a Target and not directly as a property because `$(IntermediateOutputPath)` and `$(OutputPath)`
are calculated properties and thus shouldn't be relied on during the initial property evaluation phase.
See https://github.com/dotnet/sdk/issues/41852.
We use `$(IntermediateOutputPath)` to ensure the file ends up in the `obj/` folder and not with sources to clearly
delineate inputs and outputs.
-->
<PropertyGroup Condition=" '$(ErrorLog)' == '' ">
<ErrorLog>$(IntermediateOutputPath)/$(MSBuildProjectName).sarif,version=2.1</ErrorLog>
</PropertyGroup>
</Target>
</Project>
1 change: 1 addition & 0 deletions build/targets/codeanalysis/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.30.0.95878" />
<PackageVersion Include="SquiggleCop.Tasks" Version="1.0.1" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
<PackageVersion Include="ExhaustiveMatching.Analyzer" Version="0.5.0" />
</ItemGroup>
Expand Down

0 comments on commit dcd925d

Please sign in to comment.