Skip to content

Commit f8aa4f2

Browse files
Merge pull request #33 from atc-net/feature/maintenance
Update to dotnet8 in pipeline, and fix atc-coding-rule-updater parameter
2 parents fca5bbc + d035e12 commit f8aa4f2

14 files changed

+90
-55
lines changed

.editorconfig

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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
9293
dotnet_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
151153
csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008
152154
csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008
153155
csharp_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
157163
csharp_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
444450
dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md
445451
dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
446452
dotnet_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
447454
dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
448455
dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md
449456
dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md
450457
dotnet_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
451459
dotnet_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/
456464
dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md
457465
dotnet_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
458467
dotnet_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
459470
dotnet_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
460472
dotnet_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
481493
dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md
482494
dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md
483495
dotnet_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
484497
dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md
485498
dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md
486499
dotnet_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
494507
dotnet_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
##########################################

.github/workflows/post-integration.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: 🛒 Checkout repository
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.PAT_WORKFLOWS }}
@@ -30,16 +30,16 @@ jobs:
3030
with:
3131
setAllVars: true
3232

33-
- name: ⚙️ Setup dotnet 6.0.x
34-
uses: actions/setup-dotnet@v1
33+
- name: ⚙️ Setup dotnet 8.0.x
34+
uses: actions/setup-dotnet@v4
3535
with:
36-
dotnet-version: '6.0.x'
36+
dotnet-version: '8.0.x'
3737

3838
- name: ⚙️ Set up JDK 17
39-
uses: actions/setup-java@v3
40-
with:
41-
java-version: 17
42-
distribution: 'zulu'
39+
uses: actions/setup-java@v3
40+
with:
41+
java-version: 17
42+
distribution: 'zulu'
4343

4444
- name: 🧹 Clean
4545
run: dotnet clean -c Release && dotnet nuget locals all --clear

.github/workflows/pre-integration.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- name: 🛒 Checkout repository
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

22-
- name: ⚙️ Setup dotnet 6.0.x
23-
uses: actions/setup-dotnet@v1
22+
- name: ⚙️ Setup dotnet 8.0.x
23+
uses: actions/setup-dotnet@v4
2424
with:
25-
dotnet-version: '6.0.x'
25+
dotnet-version: '8.0.x'
2626

2727
- name: 🧹 Clean
2828
run: dotnet clean -c Release && dotnet nuget locals all --clear
@@ -39,14 +39,14 @@ jobs:
3939
- dotnet-build
4040
steps:
4141
- name: 🛒 Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 0
4545

46-
- name: ⚙️ Setup dotnet 6.0.x
47-
uses: actions/setup-dotnet@v1
46+
- name: ⚙️ Setup dotnet 8.0.x
47+
uses: actions/setup-dotnet@v4
4848
with:
49-
dotnet-version: '6.0.x'
49+
dotnet-version: '8.0.x'
5050

5151
- name: 🔁 Restore packages
5252
run: dotnet restore

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: 🛒 Checkout repository
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020
token: ${{ secrets.PAT_WORKFLOWS }}
@@ -27,10 +27,10 @@ jobs:
2727
with:
2828
setAllVars: true
2929

30-
- name: ⚙️ Setup dotnet 6.0.x
31-
uses: actions/setup-dotnet@v1
30+
- name: ⚙️ Setup dotnet 8.0.x
31+
uses: actions/setup-dotnet@v4
3232
with:
33-
dotnet-version: '6.0.x'
33+
dotnet-version: '8.0.x'
3434

3535
- name: 🧹 Clean
3636
run: dotnet clean -c Release && dotnet nuget locals all --clear

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<PropertyGroup Label="Compile settings">
1818
<Nullable>enable</Nullable>
19-
<LangVersion>10.0</LangVersion>
19+
<LangVersion>12.0</LangVersion>
2020
<ImplicitUsings>enable</ImplicitUsings>
21-
<TargetFramework>net6.0</TargetFramework>
21+
<TargetFramework>net8.0</TargetFramework>
2222
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2323
<NoWarn>1573,1591,1712</NoWarn>
2424

@@ -43,10 +43,10 @@
4343
<ItemGroup Label="Code Analyzers">
4444
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
4545
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
46-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62" PrivateAssets="All" />
46+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.146" PrivateAssets="All" />
4747
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
4848
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
49-
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.4.0.72892" PrivateAssets="All" />
49+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495" PrivateAssets="All" />
5050
</ItemGroup>
5151

5252
</Project>

atc-coding-rules-updater.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
2-
"mappings": {
3-
"src": { "Paths": [ "src" ] },
4-
"test": { "Paths": [ "test" ] }
5-
}
2+
"projectTarget": "DotNet8",
3+
"useLatestMinorNugetVersion": true,
4+
"useTemporarySuppressions": false,
5+
"temporarySuppressionAsExcel": false,
6+
"analyzerProviderCollectingMode": "LocalCache",
7+
"mappings": {
8+
"src": {
9+
"paths": [
10+
"src"
11+
]
12+
},
13+
"test": {
14+
"paths": [
15+
"test"
16+
]
17+
}
18+
}
619
}

atc-coding-rules-updater.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ atc-coding-rules-updater `
99
run `
1010
-p $currentPath `
1111
--optionsPath $currentPath'\atc-coding-rules-updater.json' `
12-
-v
12+
--verbose

src/.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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: src
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
##########################################

src/Atc.Test/Atc.Test.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="4.18.0" />
18-
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.0" />
19-
<PackageReference Include="FluentAssertions" Version="6.11.0" />
20-
<PackageReference Include="NSubstitute" Version="5.0.0" />
21-
<PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
22-
<PackageReference Include="System.Text.Json" Version="7.0.3" />
17+
<PackageReference Include="AutoFixture.AutoNSubstitute" Version="4.18.1" />
18+
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.1" />
19+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
20+
<PackageReference Include="NSubstitute" Version="5.1.0" />
21+
<PackageReference Include="xunit.extensibility.core" Version="2.7.0" />
22+
<PackageReference Include="System.Text.Json" Version="8.0.3" />
2323
</ItemGroup>
2424

2525
</Project>

src/Atc.Test/SubstituteExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ namespace Atc.Test;
88
"AsyncUsage",
99
"AsyncFixer03:Fire-and-forget async-void methods or delegates",
1010
Justification = "Calls on substitutes are made for validation, await is not required.")]
11+
[SuppressMessage(
12+
"AsyncUsage",
13+
"MA0147:Avoid async void method for delegate",
14+
Justification = "OK.")]
1115
public static class SubstituteExtensions
1216
{
1317
/// <summary>

0 commit comments

Comments
 (0)