Skip to content

Commit e6b18d1

Browse files
committed
# Conflicts:
# version.json
1 parent 926b3e1 commit e6b18d1

File tree

77 files changed

+10703
-407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+10703
-407
lines changed

.config/dotnet-tools.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
"dotnet-verify"
1616
],
1717
"rollForward": false
18+
},
19+
"squigglecop.tool": {
20+
"version": "1.0.13",
21+
"commands": [
22+
"dotnet-squigglecop"
23+
],
24+
"rollForward": false
1825
}
1926
}
2027
}

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
build:
3333
strategy:
3434
matrix:
35-
os: [windows-2022, ubuntu-22.04]
35+
os: [windows-latest, ubuntu-latest]
3636

3737
runs-on: ${{ matrix.os }}
3838

@@ -92,6 +92,13 @@ jobs:
9292
path: |
9393
**/*.received.*
9494
95+
- name: Upload SARIF files
96+
uses: actions/upload-artifact@v4
97+
if: success() || failure()
98+
with:
99+
name: SARIF files (${{ matrix.os }})
100+
path: ./artifacts/obj/**/*.sarif
101+
95102
- name: Upload Test Report
96103
uses: actions/upload-artifact@v4
97104
if: success() || failure()

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ on:
55
release:
66
types:
77
- published # Run the workflow when a new GitHub release is published
8+
- edited
9+
- prereleased
10+
- released
811

912
permissions:
1013
security-events: write # required for CodeQL
1114
packages: read
1215
contents: read
1316
actions: read
1417

18+
env:
19+
PublicRelease: true # We want to generate stable package versions without the git hash in this action
20+
1521
jobs:
1622
build:
1723
uses: ./.github/workflows/main.yml

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@ We welcome contributions. If you want to contribute to existing issues, check th
44
[help wanted](https://github.com/rjmurillo/EffectiveCSharp.Analyzers/labels/help%20wanted) or
55
[good first issue](https://github.com/rjmurillo/EffectiveCSharp.Analyzers/labels/good%20first%20issue) items in the backlog.
66

7-
If you have new ideas or want to complain about bugs, feel free to [create a new issue](https://github.com/rjmurillo/EffectiveCSharp.Analyzers/issues/new).
7+
If you have new ideas or want to complain about bugs, feel free to [create a new issue](https://github.com/rjmurillo/EffectiveCSharp.Analyzers/issues/new).
8+
9+
## Updating SquiggleCop baselines
10+
11+
To update SquiggleCop baselines, run this command and review and commit the results:
12+
13+
```powershell
14+
dotnet clean && dotnet build /p:PedanticMode=true /p:SquiggleCop_AutoBaseline=true
15+
```
16+
17+
`$(PedanticMode)` turns on the CI configuration (e.g. `TreatWarningsAsErrors`) and `$(SquiggleCop_AutoBaseline)`

build/perf/baseline.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"release": "1.0.0",
3-
"label": "v.1.0.0",
4-
"sha": "e76647befbd50a2af11a4b888287542738b6e934"
2+
"release": "0.1.0",
3+
"label": "v0.1.0",
4+
"sha": "c0c5d965e88f59c3acbd867a74b55eed052df5b1"
55
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Get-ChildItem *.csproj -recurse -File | ForEach-Object{
2+
dotnet clean $_.FullName && dotnet build $_.FullName /p:PedanticMode=true /p:SquiggleCop_AutoBaseline=true
3+
}

build/targets/codeanalysis/CodeAnalysis.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>
35+
<PackageReference Include="SquiggleCop.Tasks">
36+
<PrivateAssets>all</PrivateAssets>
37+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38+
</PackageReference>
3539
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
3640
<PrivateAssets>all</PrivateAssets>
3741
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
<Project>
2+
<PropertyGroup Label="Computed properties">
3+
<PedanticMode Condition=" '$(PedanticMode)' == '' ">$([MSBuild]::ValueOrDefault('$(ContinuousIntegrationBuild)', 'false'))</PedanticMode>
4+
<TreatWarningsAsErrors>$(PedanticMode)</TreatWarningsAsErrors>
5+
<MSBuildTreatWarningsAsErrors>$(PedanticMode)</MSBuildTreatWarningsAsErrors>
6+
<SquiggleCop_Enabled>$(PedanticMode)</SquiggleCop_Enabled>
7+
</PropertyGroup>
8+
9+
<Target Name="SetErrorLog" BeforeTargets="CoreCompile">
10+
<!--
11+
ErrorLog is needed for SquiggleCop.
12+
13+
The value is set in a Target and not directly as a property because `$(IntermediateOutputPath)` and `$(OutputPath)`
14+
are calculated properties and thus shouldn't be relied on during the initial property evaluation phase.
15+
See https://github.com/dotnet/sdk/issues/41852.
16+
17+
We use `$(IntermediateOutputPath)` to ensure the file ends up in the `obj/` folder and not with sources to clearly
18+
delineate inputs and outputs.
19+
-->
20+
<PropertyGroup Condition=" '$(ErrorLog)' == '' ">
21+
<ErrorLog>$(IntermediateOutputPath)/$(MSBuildProjectName).sarif,version=2.1</ErrorLog>
22+
</PropertyGroup>
23+
</Target>
224
</Project>

build/targets/codeanalysis/Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
55
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
66
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
7-
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.30.0.95878" />
7+
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.30.0.95878" />
8+
<PackageVersion Include="SquiggleCop.Tasks" Version="1.0.8" />
89
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
910
<PackageVersion Include="ExhaustiveMatching.Analyzer" Version="0.5.0" />
1011
</ItemGroup>

build/targets/compiler/Compiler.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77

8-
<ItemGroup>
9-
<PackageReference Include="PolySharp">
10-
<PrivateAssets>all</PrivateAssets>
11-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
12-
</PackageReference>
13-
</ItemGroup>
14-
158
<ItemGroup>
169
<AssemblyAttribute Include="System.CLSCompliantAttribute">
1710
<_Parameter1>false</_Parameter1>

0 commit comments

Comments
 (0)