Skip to content

Commit 5094e89

Browse files
authored
Add rule exception for Central Package Management rule (#1204)
* Add exception for CPM rule * Update global.json * Update workflows * Update test project TFMs * Migrate to slnx * Add editorconfig to ignore CA2007 * Fix IDE0071
1 parent a2f467c commit 5094e89

9 files changed

Lines changed: 30 additions & 63 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
- name: Setup .NET SDK
3636
uses: actions/setup-dotnet@v5.3.0
3737
with:
38-
dotnet-version: |
39-
8.0.x
40-
6.0.x
38+
global-json-file: global.json
39+
dotnet-version: 8.0.x
4140
- name: Build
4241
run: dotnet build src --configuration Release
4342
- name: Upload packages

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup .NET SDK
2121
uses: actions/setup-dotnet@v5.3.0
2222
with:
23-
dotnet-version: 8.0.x
23+
global-json-file: global.json
2424
- name: Build
2525
run: dotnet build src --configuration Release
2626
- name: Sign NuGet packages

.repointegrity.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ignore:
2+
# It's okay to use central package management in this repo because the output is a tool package
3+
- test: DoNotUseCentralPackageManagement
4+
path: src/Directory.Packages.props

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
3-
"version": "8.0.400",
3+
"version": "10.0.0",
4+
"allowPrerelease": false,
45
"rollForward": "latestFeature"
56
}
67
}

src/AppCommon/Commands/AzureServiceBusCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ protected override async Task<QueueDetails> GetData(CancellationToken cancellati
135135
Throughput = (long?)maxThroughput,
136136
DailyThroughputFromBroker = [.. data.Values]
137137
});
138-
Out.WriteLine($" - Max daily throughput: {maxThroughput} ({start.ToShortDateString()} - {end.ToShortDateString()})");
138+
Out.WriteLine($" - Max daily throughput: {maxThroughput} ({start:d} - {end:d})");
139139
}
140140
else
141141
{
142-
Out.WriteLine($" - No throughput detected for the period {start.ToShortDateString()} - {end.ToShortDateString()}, ignoring");
142+
Out.WriteLine($" - No throughput detected for the period {start:d} - {end:d}, ignoring");
143143
}
144144
}
145145

src/Particular.EndpointThroughputCounter.sln

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path="Directory.Packages.props" />
4+
</Folder>
5+
<Project Path="AppCommon/AppCommon.csproj" />
6+
<Project Path="Exe/Particular.EndpointThroughputCounter.Exe.csproj" />
7+
<Project Path="Query/Particular.ThroughputQuery.csproj" />
8+
<Project Path="Tests/Tests.csproj" />
9+
<Project Path="Tool/Particular.EndpointThroughputCounter.csproj" />
10+
</Solution>

src/Query/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# CA2007: Consider calling ConfigureAwait on the awaited task
4+
dotnet_diagnostic.CA2007.severity = silent

src/Tests/Tests.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -10,11 +10,14 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="GitHubActionsTestLogger" />
13-
<PackageReference Include="ICSharpCode.Decompiler" />
1413
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1514
<PackageReference Include="NUnit" />
1615
<PackageReference Include="NUnit.Analyzers" />
1716
<PackageReference Include="NUnit3TestAdapter" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="ICSharpCode.Decompiler" />
1821
<PackageReference Include="Particular.Approvals" />
1922
<PackageReference Include="PublicApiGenerator" />
2023
</ItemGroup>

0 commit comments

Comments
 (0)