11# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2- # Version: 1.0.9
3- # Updated: 01-02-2022
2+ # Version: 1.0.0
3+ # Updated: 25-09-2023
44# Location: Root
5- # Distribution: DotNet6
5+ # Distribution: DotNet8
66# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77
88# #########################################
@@ -87,6 +87,7 @@ dotnet_separate_import_directive_groups = false
8787# .NET Code Style Settings
8888# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
8989[* .{cs,csx,cake} ]
90+
9091# "this." and "Me." qualifiers
9192# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
9293dotnet_style_qualification_for_field = false
@@ -146,12 +147,17 @@ dotnet_style_operator_placement_when_wrapping = end_of_line
146147# C# Code Style Settings
147148# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings
148149[* .{cs,csx,cake} ]
150+
149151# Implicit and explicit types
150152# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
151153csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008
152154csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008
153155csharp_style_var_elsewhere = true # IDE0007 and IDE0008
154156
157+ # Namespace declaration preferences
158+ # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022
159+ csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161
160+
155161# Expression-bodied members
156162# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
157163csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021
@@ -195,8 +201,8 @@ csharp_style_unused_value_assignment_preference = discard_variable
195201
196202# Index and range preferences
197203# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
198- csharp_style_prefer_index_operator = true # IDE0056
199- csharp_style_prefer_range_operator = true # IDE0057
204+ csharp_style_prefer_index_operator = true : suggestion # IDE0056
205+ csharp_style_prefer_range_operator = true : suggestion # IDE0057
200206
201207# Miscellaneous preferences
202208# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
@@ -444,19 +450,25 @@ dotnet_naming_rule.parameters_rule.severity = warning
444450dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md
445451dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
446452dotnet_diagnostic.MA0006.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0006.md
453+ dotnet_diagnostic.MA0011.severity = none # Duplicate of CA1305
447454dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
448455dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md
449456dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md
450457dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md
458+ dotnet_diagnostic.MA0038.severity = none # Duplicate of CA1822
451459dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md
452460
453461
454462# Microsoft - Code Analysis
455463# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
456464dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md
457465dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md
466+ dotnet_diagnostic.CA1305.severity = error
458467dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
468+ dotnet_diagnostic.CA1812.severity = none
469+ dotnet_diagnostic.CA1822.severity = suggestion
459470dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
471+ dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
460472dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
461473
462474
@@ -481,6 +493,7 @@ dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net
481493dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md
482494dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md
483495dotnet_diagnostic.SA1600.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1600.md
496+ dotnet_diagnostic.SA1601.severity = none
484497dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md
485498dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md
486499dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md
@@ -494,6 +507,11 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
494507dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
495508
496509
510+ # #########################################
511+ # Custom - File Extension Settings
512+ # #########################################
513+
514+
497515# #########################################
498516# Custom - Code Analyzers Rules
499517# #########################################
0 commit comments