Skip to content

Commit df49af9

Browse files
Merge pull request #155 from atc-net/feature/dotnet8_upgrade
dotnet8 upgrade
2 parents 551070d + da48e28 commit df49af9

31 files changed

+159
-137
lines changed

.editorconfig

Lines changed: 26 additions & 6 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: 24-11-2022
2+
# Version: 1.0.0
3+
# Updated: 25-09-2023
44
# Location: Root
5-
# Distribution: DotNet7
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,6 +147,7 @@ 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
@@ -199,8 +201,8 @@ csharp_style_unused_value_assignment_preference = discard_variable
199201

200202
# Index and range preferences
201203
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
202-
csharp_style_prefer_index_operator = true # IDE0056
203-
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
204206

205207
# Miscellaneous preferences
206208
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
@@ -448,19 +450,25 @@ dotnet_naming_rule.parameters_rule.severity = warning
448450
dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md
449451
dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
450452
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
451454
dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
452455
dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md
453456
dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md
454457
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
455459
dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md
456460

457461

458462
# Microsoft - Code Analysis
459463
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
460464
dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md
461465
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
462467
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
463470
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
464472
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
465473

466474

@@ -485,6 +493,7 @@ dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net
485493
dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md
486494
dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md
487495
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
488497
dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md
489498
dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md
490499
dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md
@@ -511,6 +520,8 @@ dotnet_diagnostic.IDE0057.severity = none # Substring can be simplifie
511520

512521
dotnet_diagnostic.CA1054.severity = none # URI parameters should not be strings
513522
dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string, params object[])'
523+
dotnet_diagnostic.CA1859.severity = none #
524+
dotnet_diagnostic.CA1860.severity = none #
514525
dotnet_diagnostic.CA2007.severity = none # Consider calling ConfigureAwait on the awaited task
515526
dotnet_diagnostic.CA2254.severity = none # For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string, params object[])'
516527

@@ -520,4 +531,13 @@ dotnet_diagnostic.MA0075.severity = none # Do not use implicit cultur
520531
dotnet_diagnostic.MA0076.severity = none # Do not use implicit culture-sensitive ToString in interpolated strings
521532

522533
dotnet_diagnostic.S1172.severity = none # False positive
523-
dotnet_diagnostic.S4457.severity = none # Split this method into two, one handling parameters check and the other handling the asynchronous code
534+
dotnet_diagnostic.S2589.severity = none #
535+
dotnet_diagnostic.S2629.severity = none #
536+
dotnet_diagnostic.S3267.severity = none #
537+
dotnet_diagnostic.S3878.severity = none #
538+
dotnet_diagnostic.S4457.severity = none # Split this method into two, one handling parameters check and the other handling the asynchronous code
539+
dotnet_diagnostic.S6602.severity = none #
540+
dotnet_diagnostic.S6605.severity = none #
541+
dotnet_diagnostic.S6618.severity = none #
542+
dotnet_diagnostic.S6667.severity = none #
543+
dotnet_diagnostic.S6608.severity = none #

.github/workflows/atc-coding-rules-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "ATC-rules-update"
22

33
on:
44
workflow_dispatch:
5-
schedule:
5+
schedule:
66
- cron: '0 20 * * 0'
77

88
jobs:
@@ -24,7 +24,7 @@ jobs:
2424
- name: '⚙ Install ATC Coding Rules updater'
2525
run: dotnet tool install --global atc-coding-rules-updater
2626
- name: ♻️ Run ATC Coding Rules updater
27-
run: atc-coding-rules-updater run --projectPath . --verbose --projectTarget DotNet6 --useTemporarySuppressions
27+
run: atc-coding-rules-updater run --projectPath . --verbose --projectTarget DotNet8 --useTemporarySuppressions
2828
- name: 🐛 Git - show changes
2929
shell: bash
3030
run: |

.github/workflows/post-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
with:
3131
setAllVars: true
3232

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

3838
- name: ⚙️ Set up JDK 17
3939
uses: actions/setup-java@v3

.github/workflows/pre-integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: ⚙️ Setup dotnet 6.0.x
22+
- name: ⚙️ Setup dotnet 8.0.x
2323
uses: actions/setup-dotnet@v1
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
@@ -43,10 +43,10 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545

46-
- name: ⚙️ Setup dotnet 6.0.x
46+
- name: ⚙️ Setup dotnet 8.0.x
4747
uses: actions/setup-dotnet@v1
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
with:
2828
setAllVars: true
2929

30-
- name: ⚙️ Setup dotnet 6.0.x
30+
- name: ⚙️ Setup dotnet 8.0.x
3131
uses: actions/setup-dotnet@v1
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,CA1014</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="1.0.756" 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.2.0-beta.435" PrivateAssets="All" />
49-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.49.0.57237" PrivateAssets="All" />
49+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.0.88079" PrivateAssets="All" />
5050
</ItemGroup>
5151

5252
</Project>

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,39 @@ This repository contains a CLI tool, which can be used to maintain `coding-rules
77
* Read about [atc-coding-rules](https://github.com/atc-net/atc-coding-rules)
88
* Master rule files [information](https://github.com/atc-net/atc-coding-rules/tree/main/distribution)
99

10-
## Breaking changes
11-
12-
![](https://img.shields.io/static/v1?color=ff9900&style=for-the-badge&label=&message=Breaking%20changes%20From%20Version%201.x%20to%202.x)
13-
14-
```powershell
15-
* Options Parameter Change: -r | --rootPath has changed to -p | --projectPath
16-
* CLI Tool now requires the "run" command to update rule-files
17-
```
10+
## Table of Contents
11+
- [ATC-NET Coding rules updater](#atc-net-coding-rules-updater)
12+
- [Table of Contents](#table-of-contents)
13+
- [CLI Tool](#cli-tool)
14+
- [Requirements](#requirements)
15+
- [Installation](#installation)
16+
- [Update](#update)
17+
- [Usage](#usage)
18+
- [Option --help](#option---help)
19+
- [Command run](#command-run)
20+
- [Command sanity-check](#command-sanity-check)
21+
- [Command options-file](#command-options-file)
22+
- [Example](#example)
23+
- [Options file schema / example](#options-file-schema--example)
24+
- [atc-coding-rules-updater.json example 1](#atc-coding-rules-updaterjson-example-1)
25+
- [atc-coding-rules-updater.json example 2](#atc-coding-rules-updaterjson-example-2)
26+
- [atc-coding-rules-updater.json default](#atc-coding-rules-updaterjson-default)
27+
- [CLI Tool Usage from powershell](#cli-tool-usage-from-powershell)
28+
- [Deep dive in what `atc-coding-rules-updater` actual does and doesn't do](#deep-dive-in-what-atc-coding-rules-updater-actual-does-and-doesnt-do)
29+
- [A use case-scenario for coding rules structure setups - Scenario A](#a-use-case-scenario-for-coding-rules-structure-setups---scenario-a)
30+
- [A use case-scenario for coding rules structure setups - Scenario B](#a-use-case-scenario-for-coding-rules-structure-setups---scenario-b)
31+
- [For both use-case scenarios](#for-both-use-case-scenarios)
32+
- [Temporary suppressions](#temporary-suppressions)
33+
- [Build](#build)
34+
- [How to contribute](#how-to-contribute)
1835

1936
## CLI Tool
2037

2138
The Atc.CodingRules.Updater.CLI library is available through a cross platform command line application.
2239

2340
### Requirements
2441

25-
* [.NET 6 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
42+
* [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
2643

2744
### Installation
2845

atc-coding-rules-updater.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projectTarget": "DotNet6",
2+
"projectTarget": "DotNet8",
33
"mappings": {
44
"src": { "paths": [ "src" ] },
55
"test": { "paths": [ "test" ] }

sample/atc-coding-rules-updater.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projectTarget": "DotNet6",
2+
"projectTarget": "DotNet8",
33
"useLatestMinorNugetVersion": true,
44
"useTemporarySuppressions": false,
55
"temporarySuppressionAsExcel": false,

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: 24-11-2022
2+
# Version: 1.0.0
3+
# Updated: 25-09-2023
44
# Location: src
5-
# Distribution: DotNet7
5+
# Distribution: DotNet8
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

88
##########################################

0 commit comments

Comments
 (0)