Skip to content

Commit 0748167

Browse files
authored
Merge pull request #85 from atc-net/feature/dotnet9
Dotnet9
2 parents 704a005 + 8002e23 commit 0748167

File tree

10 files changed

+856
-0
lines changed

10 files changed

+856
-0
lines changed

distribution/dotnet8/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException thro
470470
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
471471
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
472472
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
473+
dotnet_diagnostic.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
473474
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
474475
dotnet_diagnostic.CA1812.severity = none
475476
dotnet_diagnostic.CA1822.severity = suggestion
@@ -505,7 +506,16 @@ dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is onl
505506
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
506507
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
507508
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
509+
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
510+
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
511+
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
512+
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
508513
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
514+
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
515+
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
516+
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
517+
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
518+
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified
509519

510520

511521
# Microsoft - Compiler Errors
@@ -542,6 +552,7 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
542552
# https://rules.sonarsource.com/csharp
543553
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
544554
dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
555+
dotnet_diagnostic.S3358.severity = none # Extract this nested ternary operation into an independent statement.
545556
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
546557
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
547558
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"

distribution/dotnet9/.editorconfig

Lines changed: 574 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup Label="Metadata configuration">
5+
<OrganizationName><!-- insert organization name here --></OrganizationName>
6+
<RepositoryName><!-- insert repository name here --></RepositoryName>
7+
</PropertyGroup>
8+
9+
<!-- Solution wide properties -->
10+
<PropertyGroup Label="Assembly Naming">
11+
<Company>$(OrganizationName)</Company>
12+
<Authors>$(OrganizationName)</Authors>
13+
<NeutralLanguage>en</NeutralLanguage>
14+
<DefaultLanguage>en-US</DefaultLanguage>
15+
</PropertyGroup>
16+
17+
<PropertyGroup Label="Compile settings">
18+
<Nullable>enable</Nullable>
19+
<LangVersion>13.0</LangVersion>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<TargetFramework>net9.0</TargetFramework>
22+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
23+
<NoWarn>1573,1591,1712,CA1014</NoWarn>
24+
25+
<!-- Used by code coverage -->
26+
<DebugType>full</DebugType>
27+
<DebugSymbols>true</DebugSymbols>
28+
</PropertyGroup>
29+
30+
<PropertyGroup Label="Analyzer settings">
31+
<AnalysisLevel>latest-All</AnalysisLevel>
32+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
33+
</PropertyGroup>
34+
35+
<!-- Treat warnings as errors are always on when building in release -->
36+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
37+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
38+
</PropertyGroup>
39+
40+
<!-- Shared code analyzers used for all projects in the solution -->
41+
<ItemGroup Label="Code Analyzers">
42+
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
43+
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
44+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.155" PrivateAssets="All" />
45+
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
46+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
47+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.26.0.92422" PrivateAssets="All" />
48+
</ItemGroup>
49+
50+
</Project>

distribution/dotnet9/global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"rollForward": "latestMajor",
4+
"allowPrerelease": false
5+
}
6+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2+
# Version: 1.0.0
3+
# Updated: 03-06-2024
4+
# Location: sample
5+
# Distribution: DotNet9
6+
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
7+
8+
##########################################
9+
# Code Analyzers Rules
10+
##########################################
11+
[*.{cs,csx,cake}]
12+
13+
# AsyncFixer
14+
# http://www.asyncfixer.com
15+
16+
17+
# Asyncify
18+
# https://github.com/hvanbakel/Asyncify-CSharp
19+
20+
21+
# Meziantou
22+
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
23+
24+
25+
# Microsoft - Code Analysis
26+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
27+
28+
29+
# Microsoft - Compiler Errors
30+
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/
31+
32+
33+
# Microsoft - FxCop
34+
# https://github.com/dotnet/roslyn-analyzers
35+
36+
37+
# SecurityCodeScan
38+
# https://security-code-scan.github.io/
39+
40+
41+
# StyleCop
42+
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
43+
44+
# SonarAnalyzer.CSharp
45+
# https://rules.sonarsource.com/csharp
46+
47+
dotnet_diagnostic.S1075.severity = none # Refactor your code not to use hardcoded absolute paths or URIs
48+
49+
##########################################
50+
# Custom - Code Analyzers Rules
51+
##########################################
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
6+
-->
7+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
8+
9+
<!-- Place any common sample properties here -->
10+
11+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2+
# Version: 1.0.0
3+
# Updated: 03-06-2024
4+
# Location: src
5+
# Distribution: DotNet9
6+
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
7+
8+
##########################################
9+
# Code Analyzers Rules
10+
##########################################
11+
[*.{cs,csx,cake}]
12+
13+
# AsyncFixer
14+
# http://www.asyncfixer.com
15+
16+
17+
# Asyncify
18+
# https://github.com/hvanbakel/Asyncify-CSharp
19+
20+
21+
# Meziantou
22+
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
23+
24+
25+
# Microsoft - Code Analysis
26+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
27+
28+
29+
# Microsoft - Compiler Errors
30+
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/
31+
32+
33+
# SecurityCodeScan
34+
# https://security-code-scan.github.io/
35+
36+
37+
# StyleCop
38+
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
39+
40+
41+
# SonarAnalyzer.CSharp
42+
# https://rules.sonarsource.com/csharp
43+
44+
45+
##########################################
46+
# Custom - Code Analyzers Rules
47+
##########################################
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
6+
-->
7+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
8+
9+
<PropertyGroup Label="Build instructions">
10+
<OutputType>Library</OutputType>
11+
<!-- Creates a regular package and a symbols package -->
12+
<IncludeSymbols>true</IncludeSymbols>
13+
<!-- Creates symbol package in the new .snupkg format -->
14+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
15+
<!--
16+
Instruct the build system to embed project source files that are not tracked by the source control
17+
or imported from a source package to the generated PDB.
18+
-->
19+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
20+
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
21+
<DebugType>embedded</DebugType>
22+
</PropertyGroup>
23+
</Project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2+
# Version: 1.0.0
3+
# Updated: 25-09-2023
4+
# Location: test
5+
# Distribution: DotNet8
6+
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
7+
8+
##########################################
9+
# Code Analyzers Rules
10+
##########################################
11+
[*.{cs,csx,cake}]
12+
13+
# AsyncFixer
14+
# http://www.asyncfixer.com
15+
16+
17+
# Asyncify
18+
# https://github.com/hvanbakel/Asyncify-CSharp
19+
20+
21+
# Meziantou
22+
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
23+
dotnet_diagnostic.MA0004.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
24+
dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
25+
dotnet_diagnostic.MA0051.severity = none # Method Length
26+
27+
28+
# Microsoft - Code Analysis
29+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
30+
dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md
31+
dotnet_diagnostic.CA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1602.md
32+
dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
33+
dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
34+
35+
36+
# Microsoft - Compiler Errors
37+
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/
38+
39+
40+
# SecurityCodeScan
41+
# https://security-code-scan.github.io/
42+
43+
44+
# StyleCop
45+
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
46+
dotnet_diagnostic.SA1122.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md
47+
dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md
48+
49+
50+
# SonarAnalyzer.CSharp
51+
# https://rules.sonarsource.com/csharp
52+
53+
54+
##########################################
55+
# Custom - Code Analyzers Rules
56+
##########################################
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
6+
-->
7+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
8+
9+
<PropertyGroup Label="Compile settings">
10+
<Nullable>annotations</Nullable>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Atc.Test" Version="1.0.89" />
15+
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" PrivateAssets="All" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<Using Include="Atc.Test" />
20+
<Using Include="AutoFixture" />
21+
<Using Include="AutoFixture.Xunit2" />
22+
<Using Include="FluentAssertions" />
23+
<Using Include="NSubstitute" />
24+
<Using Include="Xunit" />
25+
</ItemGroup>
26+
27+
</Project>

0 commit comments

Comments
 (0)