Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SquiggleCop to baseline analyzer settings #166

Merged
merged 8 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -15,6 +15,13 @@
"dotnet-verify"
],
"rollForward": false
},
"squigglecop.tool": {
"version": "1.0.8",
"commands": [
"dotnet-squigglecop"
],
"rollForward": false
}
}
}
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ permissions:
jobs:
build:
strategy:
fail-fast: false # Run all OSes, even if one fails, to help narrow down issues that only impact some platforms
matrix:
os: [windows-2022, ubuntu-22.04]

@@ -73,6 +74,13 @@ jobs:
path: |
**/*.received.*

- name: Upload SARIF files
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: SARIF files (${{ matrix.os }})
path: ./artifacts/obj/**/*.sarif

- name: Upload Test Report
uses: actions/upload-artifact@v4
if: success() || failure()
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -5,3 +5,14 @@ We welcome contributions. If you want to contribute to existing issues, check th
[good first issue](https://github.com/rjmurillo/moq.analyzers/labels/good%20first%20issue) items in the backlog.

If you have new ideas or want to complain about bugs, feel free to [create a new issue](https://github.com/rjmurillo/moq.analyzers/issues/new).

## Updating SquiggleCop baselines

To update SquiggleCop baselines, run this command and review and commit the results:

```powershell
dotnet clean && dotnet build /p:PedanticMode=true /p:SquiggleCop_AutoBaseline=true
```

`$(PedanticMode)` turns on the CI configuration (e.g. `TreatWarningsAsErrors`) and `$(SquiggleCop_AutoBaseline)`
automatically accepts the new baseline.
4 changes: 4 additions & 0 deletions build/targets/codeanalysis/CodeAnalysis.props
Original file line number Diff line number Diff line change
@@ -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>
17 changes: 17 additions & 0 deletions build/targets/codeanalysis/CodeAnalysis.targets
Original file line number Diff line number Diff line change
@@ -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
@@ -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.8" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
<PackageVersion Include="ExhaustiveMatching.Analyzer" Version="0.5.0" />
</ItemGroup>
1,562 changes: 1,562 additions & 0 deletions src/Moq.Analyzers/SquiggleCop.Baseline.yaml

Large diffs are not rendered by default.

1,574 changes: 1,574 additions & 0 deletions src/tools/PerfDiff/SquiggleCop.Baseline.yaml

Large diffs are not rendered by default.

1,576 changes: 1,576 additions & 0 deletions tests/Moq.Analyzers.Benchmarks/SquiggleCop.Baseline.yaml

Large diffs are not rendered by default.

1,657 changes: 1,657 additions & 0 deletions tests/Moq.Analyzers.Test/SquiggleCop.Baseline.yaml

Large diffs are not rendered by default.