Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions distribution/dotnet8/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException thro
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
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)
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1822.severity = suggestion
Expand Down Expand Up @@ -505,7 +506,16 @@ dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is onl
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified


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

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions distribution/dotnet9/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Metadata configuration">
<OrganizationName><!-- insert organization name here --></OrganizationName>
<RepositoryName><!-- insert repository name here --></RepositoryName>
</PropertyGroup>

<!-- Solution wide properties -->
<PropertyGroup Label="Assembly Naming">
<Company>$(OrganizationName)</Company>
<Authors>$(OrganizationName)</Authors>
<NeutralLanguage>en</NeutralLanguage>
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>

<PropertyGroup Label="Compile settings">
<Nullable>enable</Nullable>
<LangVersion>13.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net9.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1573,1591,1712,CA1014</NoWarn>

<!-- Used by code coverage -->
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Label="Analyzer settings">
<AnalysisLevel>latest-All</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<!-- Treat warnings as errors are always on when building in release -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<!-- Shared code analyzers used for all projects in the solution -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.155" PrivateAssets="All" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.26.0.92422" PrivateAssets="All" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions distribution/dotnet9/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
51 changes: 51 additions & 0 deletions distribution/dotnet9/sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 03-06-2024
# Location: sample
# Distribution: DotNet9
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

##########################################
# Code Analyzers Rules
##########################################
[*.{cs,csx,cake}]

# AsyncFixer
# http://www.asyncfixer.com


# Asyncify
# https://github.com/hvanbakel/Asyncify-CSharp


# Meziantou
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/


# Microsoft - Compiler Errors
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/


# Microsoft - FxCop
# https://github.com/dotnet/roslyn-analyzers


# SecurityCodeScan
# https://security-code-scan.github.io/


# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers

# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp

dotnet_diagnostic.S1075.severity = none # Refactor your code not to use hardcoded absolute paths or URIs

##########################################
# Custom - Code Analyzers Rules
##########################################
11 changes: 11 additions & 0 deletions distribution/dotnet9/sample/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />

<!-- Place any common sample properties here -->

</Project>
47 changes: 47 additions & 0 deletions distribution/dotnet9/src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 03-06-2024
# Location: src
# Distribution: DotNet9
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

##########################################
# Code Analyzers Rules
##########################################
[*.{cs,csx,cake}]

# AsyncFixer
# http://www.asyncfixer.com


# Asyncify
# https://github.com/hvanbakel/Asyncify-CSharp


# Meziantou
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/


# Microsoft - Compiler Errors
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/


# SecurityCodeScan
# https://security-code-scan.github.io/


# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers


# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp


##########################################
# Custom - Code Analyzers Rules
##########################################
23 changes: 23 additions & 0 deletions distribution/dotnet9/src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />

<PropertyGroup Label="Build instructions">
<OutputType>Library</OutputType>
<!-- Creates a regular package and a symbols package -->
<IncludeSymbols>true</IncludeSymbols>
<!-- Creates symbol package in the new .snupkg format -->
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!--
Instruct the build system to embed project source files that are not tracked by the source control
or imported from a source package to the generated PDB.
-->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
<DebugType>embedded</DebugType>
</PropertyGroup>
</Project>
56 changes: 56 additions & 0 deletions distribution/dotnet9/test/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 25-09-2023
# Location: test
# Distribution: DotNet8
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

##########################################
# Code Analyzers Rules
##########################################
[*.{cs,csx,cake}]

# AsyncFixer
# http://www.asyncfixer.com


# Asyncify
# https://github.com/hvanbakel/Asyncify-CSharp


# Meziantou
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
dotnet_diagnostic.MA0004.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
dotnet_diagnostic.MA0051.severity = none # Method Length


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md
dotnet_diagnostic.CA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1602.md
dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md


# Microsoft - Compiler Errors
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/


# SecurityCodeScan
# https://security-code-scan.github.io/


# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
dotnet_diagnostic.SA1122.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md
dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md


# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp


##########################################
# Custom - Code Analyzers Rules
##########################################
27 changes: 27 additions & 0 deletions distribution/dotnet9/test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Add any shared properties you want for the projects under this directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />

<PropertyGroup Label="Compile settings">
<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc.Test" Version="1.0.89" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<Using Include="Atc.Test" />
<Using Include="AutoFixture" />
<Using Include="AutoFixture.Xunit2" />
<Using Include="FluentAssertions" />
<Using Include="NSubstitute" />
<Using Include="Xunit" />
</ItemGroup>

</Project>