Skip to content

Commit 808bca0

Browse files
committed
Use editorconfig instead of old stylecop files and smaller cleanup
1 parent d573062 commit 808bca0

File tree

6 files changed

+596
-19
lines changed

6 files changed

+596
-19
lines changed

.editorconfig

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

LinkDotNet.Blog.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B6AF0B6E-14FB-4737-A69B-13B0D7195E2B}"
1919
ProjectSection(SolutionItems) = preProject
2020
Readme.md = Readme.md
21-
stylecop.analyzers.ruleset = stylecop.analyzers.ruleset
22-
stylecop.json = stylecop.json
21+
.editorconfig = .editorconfig
2322
EndProjectSection
2423
EndProject
2524
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{86FD0EB5-13F9-4F1C-ADA1-072EEFEFF1E9}"
2625
ProjectSection(SolutionItems) = preProject
2726
src\Directory.Build.props = src\Directory.Build.props
27+
src\.editorconfig = src\.editorconfig
2828
EndProjectSection
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CAD2F4A3-1282-49B5-B0AB-655CDBED0A35}"
3131
ProjectSection(SolutionItems) = preProject
3232
tests\Directory.Build.props = tests\Directory.Build.props
33+
tests\.editorconfig = tests\.editorconfig
3334
EndProjectSection
3435
EndProject
3536
Global

src/.editorconfig

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2+
# Version: 1.0.5
3+
# Updated: 02-05-2021
4+
# Location: Src
5+
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
6+
7+
##########################################
8+
# Code Analyzers Rules
9+
##########################################
10+
[*.{cs,csx,cake}]
11+
12+
# AsyncFixer
13+
# http://www.asyncfixer.com
14+
15+
16+
# Asyncify
17+
# https://github.com/hvanbakel/Asyncify-CSharp
18+
19+
20+
# Meziantou
21+
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
22+
23+
24+
# Microsoft - Code Analysis
25+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
26+
27+
28+
# SecurityCodeScan
29+
# https://security-code-scan.github.io/
30+
31+
32+
# SonarAnalyzer.CSharp
33+
# https://rules.sonarsource.com/csharp
34+
35+
36+
##########################################
37+
# Custom - Code Analyzers Rules
38+
##########################################

src/Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
</PropertyGroup>
2727

2828
<PropertyGroup>
29-
<WarningLevel>99</WarningLevel>
3029
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3130
</PropertyGroup>
3231

33-
</Project>
32+
</Project>

src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,8 @@
1919
<ProjectReference Include="..\LinkDotNet.Blog.Infrastructure\LinkDotNet.Blog.Infrastructure.csproj" />
2020
</ItemGroup>
2121

22-
<ItemGroup>
23-
<_ContentIncludedByDefault Remove="Areas\Identity\Pages\Account\LogOut.cshtml" />
24-
<_ContentIncludedByDefault Remove="Areas\Identity\Pages\Shared\_LoginPartial.cshtml" />
25-
</ItemGroup>
26-
2722
<ItemGroup>
2823
<InternalsVisibleTo Include="LinkDotNet.Blog.IntegrationTests" />
2924
</ItemGroup>
3025

31-
<ItemGroup>
32-
<None Update="Features\ShowBlogPost\Components\Giscus.razor.js">
33-
<DependentUpon>Giscus.razor</DependentUpon>
34-
</None>
35-
<None Update="Features\ShowBlogPost\Components\Disqus.razor.js">
36-
<DependentUpon>Disqus.razor</DependentUpon>
37-
</None>
38-
</ItemGroup>
39-
40-
</Project>
26+
</Project>

tests/.editorconfig

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2+
# Version: 1.0.5
3+
# Updated: 02-05-2021
4+
# Location: Test
5+
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
6+
7+
##########################################
8+
# Code Analyzers Rules
9+
##########################################
10+
[*.{cs,csx,cake}]
11+
12+
# AsyncFixer
13+
# http://www.asyncfixer.com
14+
15+
16+
# Asyncify
17+
# https://github.com/hvanbakel/Asyncify-CSharp
18+
19+
20+
# Meziantou
21+
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
22+
dotnet_diagnostic.MA0002.severity = silent # MA0002: IEqualityComparer<string> or IComparer<string> is missing
23+
dotnet_diagnostic.MA0004.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
24+
25+
# Microsoft - Code Analysis
26+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
27+
dotnet_diagnostic.CA1064.severity = suggestion # CA1064: Exceptions should be public
28+
dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
29+
dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
30+
31+
# SecurityCodeScan
32+
# https://security-code-scan.github.io/
33+
34+
35+
# SonarAnalyzer.CSharp
36+
# https://rules.sonarsource.com/csharp
37+
38+
39+
##########################################
40+
# Custom - Code Analyzers Rules
41+
##########################################
42+
43+
dotnet_diagnostic.CA1819.severity = suggestion # CA1819: Properties should not return arrays
44+
dotnet_diagnostic.CA1849.severity = suggestion # CA1849: Call async methods when in an async method
45+
46+
dotnet_diagnostic.xUnit1026.severity = none # xUnit1026: Theory methods should use all of their parameters

0 commit comments

Comments
 (0)