File tree Expand file tree Collapse file tree 3 files changed +100
-0
lines changed
Expand file tree Collapse file tree 3 files changed +100
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ reported a the [GibHub repository](https://github.com/dotnet-project-file-analyz
145145### Other
146146* [ ** Proj1100** Avoid using Moq] ( rules/Proj1100.md )
147147* [ ** Proj1101** Package references should have stable versions] ( rules/Proj1101.md )
148+ * [ ** Proj1102** Use Coverlet Collector or MSBuild] ( rules/Proj1102.md )
149+ * [ ** Proj1103** Coverlet requires Microsoft.NET.Test.Sdk 17.5.0 or higher] ( rules/Proj1103.md )
148150* [ ** Proj1200** Exclude private assets as project file dependency] ( rules/Proj1200.md )
149151
150152## Resource file rules
Original file line number Diff line number Diff line change 1+ ---
2+ parent : Other
3+ ancestor : MSBuild
4+ ---
5+
6+ # Proj1102: Use Coverlet Collector or MSBuild
7+ Coverlet is a cross platform code coverage framework for .NET, with support for
8+ line, branch and method coverage. The packages ` coverlet.collector ` and
9+ ` coverlet.msbuild ` have the same purpose but should not be used together. Note
10+ that ` coverlet.collector ` is preferred over the ` coverlet.msbuild ` .
11+
12+ ## Non-compliant
13+ ``` xml
14+ <Project Sdk =" Microsoft.NET.Sdk" >
15+
16+ <PropertyGroup >
17+ <TargetFramework >net8.0</TargetFramework >
18+ </PropertyGroup >
19+
20+ <ItemGroup >
21+ <PackageReference Include =" coverlet.collector" PrivateAssets =" all" />
22+ <PackageReference Include =" coverlet.msbuild" PrivateAssets =" all" />
23+ </ItemGroup >
24+
25+ </Project >
26+ ```
27+
28+ ## Compliant
29+ ``` xml
30+ <Project Sdk =" Microsoft.NET.Sdk" >
31+
32+ <PropertyGroup >
33+ <TargetFramework >net8.0</TargetFramework >
34+ </PropertyGroup >
35+
36+ <ItemGroup >
37+ <PackageReference Include =" coverlet.collector" PrivateAssets =" all" />
38+ </ItemGroup >
39+
40+ </Project >
41+ ```
42+
43+ or
44+
45+ ``` xml
46+ <Project Sdk =" Microsoft.NET.Sdk" >
47+
48+ <PropertyGroup >
49+ <TargetFramework >net8.0</TargetFramework >
50+ </PropertyGroup >
51+
52+ <ItemGroup >
53+ <PackageReference Include =" coverlet.msbuild" PrivateAssets =" all" />
54+ </ItemGroup >
55+
56+ </Project >
57+ ```
Original file line number Diff line number Diff line change 1+ ---
2+ parent : Other
3+ ancestor : MSBuild
4+ ---
5+
6+ # Proj1103: Coverlet requires Microsoft.NET.Test.Sdk 17.5.0 or higher
7+ Coverlet is a cross platform code coverage framework for .NET, with support for
8+ line, branch and method coverage. It requires ` Microsoft.NET.Test.Sdk ` 17.5.0
9+ or higher.
10+
11+ ## Non-compliant
12+ ``` xml
13+ <Project Sdk =" Microsoft.NET.Sdk" >
14+
15+ <PropertyGroup >
16+ <TargetFramework >net8.0</TargetFramework >
17+ </PropertyGroup >
18+
19+ <ItemGroup >
20+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.4.0" />
21+ <PackageReference Include =" coverlet.collector" PrivateAssets =" all" />
22+ </ItemGroup >
23+
24+ </Project >
25+ ```
26+
27+ ## Compliant
28+ ``` xml
29+ <Project Sdk =" Microsoft.NET.Sdk" >
30+
31+ <PropertyGroup >
32+ <TargetFramework >net8.0</TargetFramework >
33+ </PropertyGroup >
34+
35+ <ItemGroup >
36+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.5.0" />
37+ <PackageReference Include =" coverlet.collector" PrivateAssets =" all" />
38+ </ItemGroup >
39+
40+ </Project >
41+ ```
You can’t perform that action at this time.
0 commit comments