Skip to content

Commit 5e6e4b8

Browse files
Merge pull request #120 from atc-net/feature/dotnet7
Add dotnet7 support from coding-rules
2 parents 1a48cbb + 732fc7f commit 5e6e4b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+106
-89
lines changed

.editorconfig

Lines changed: 8 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
22
# Version: 1.0.9
3-
# Updated: 01-02-2022
3+
# Updated: 24-11-2022
44
# Location: Root
5-
# Distribution: DotNet6
5+
# Distribution: DotNet7
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

88
##########################################
@@ -152,6 +152,10 @@ csharp_style_var_for_built_in_types = true
152152
csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008
153153
csharp_style_var_elsewhere = true # IDE0007 and IDE0008
154154

155+
# Namespace declaration preferences
156+
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022
157+
csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161
158+
155159
# Expression-bodied members
156160
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
157161
csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021
@@ -515,4 +519,5 @@ dotnet_diagnostic.MA0016.severity = none # Prefer return collection a
515519
dotnet_diagnostic.MA0075.severity = none # Do not use implicit culture-sensitive ToString
516520
dotnet_diagnostic.MA0076.severity = none # Do not use implicit culture-sensitive ToString in interpolated strings
517521

518-
dotnet_diagnostic.S1172.severity = none # False positive
522+
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

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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.750" PrivateAssets="All" />
46+
<PackageReference Include="Meziantou.Analyzer" Version="1.0.756" PrivateAssets="All" />
4747
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
48-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
49-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.48.0.56517" PrivateAssets="All" />
48+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
49+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.49.0.57237" PrivateAssets="All" />
5050
</ItemGroup>
5151

5252
</Project>

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ OPTIONS:
9393
diectory)
9494
-o, --optionsPath [OPTIONSPATH] Path to an optional options json-file
9595
-t, --projectTarget [PROJECTTARGET] Sets the ProjectTarget. Valid values are: DotNetCore,
96-
DotNet5, DotNet6 (default)
96+
DotNet5, DotNet6, DotNet7 (default)
9797
--useLatestMinorNugetVersion Indicate if nuget packages should by updated to latest
9898
minor version (default true)
9999
--useTemporarySuppressions Indicate if build process should use temporary
@@ -126,8 +126,7 @@ OPTIONS:
126126
-v, --verbose Use verbose for more debug/trace information
127127
-p, --projectPath <PROJECTPATH> Path to the project directory (default current diectory)
128128
-o, --optionsPath [OPTIONSPATH] Path to an optional options json-file
129-
-t, --projectTarget [PROJECTTARGET] Sets the ProjectTarget. Valid values are: DotNetCore, DotNet5, DotNet6
130-
(default)
129+
-t, --projectTarget [PROJECTTARGET] Sets the ProjectTarget. Valid values are: DotNetCore, DotNet5, DotNet6, DotNet7 (default)
131130
```
132131

133132
#### Command <span style="color:yellow">options-file</span>
@@ -225,7 +224,7 @@ The tool has an optional options parameter, which can be used to control the pat
225224

226225
```json
227226
{
228-
"projectTarget": "DotNet6",
227+
"projectTarget": "DotNet7",
229228
"useLatestMinorNugetVersion": true,
230229
"useTemporarySuppressions": false,
231230
"temporarySuppressionAsExcel": false,

atc-coding-rules-updater.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"Mappings": {
3-
"Src": { "Paths": [ "src" ] },
4-
"Test": { "Paths": [ "test" ] }
2+
"projectTarget": "DotNet6",
3+
"mappings": {
4+
"src": { "paths": [ "src" ] },
5+
"test": { "paths": [ "test" ] }
56
}
67
}

src/.editorconfig

Lines changed: 2 additions & 2 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
22
# Version: 1.0.9
3-
# Updated: 01-02-2022
3+
# Updated: 24-11-2022
44
# Location: src
5-
# Distribution: DotNet6
5+
# Distribution: DotNet7
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

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

src/Atc.CodingRules.AnalyzerProviders/AnalyzerProviderSerialization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Atc.CodingRules.AnalyzerProviders;
22

33
public static class AnalyzerProviderSerialization
44
{
5-
public static readonly JsonSerializerOptions JsonOptions = new ()
5+
public static readonly JsonSerializerOptions JsonOptions = new()
66
{
77
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
88
WriteIndented = true,

src/Atc.CodingRules.AnalyzerProviders/Atc.CodingRules.AnalyzerProviders.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Atc" Version="2.0.209" />
13-
<PackageReference Include="HtmlAgilityPack" Version="1.11.45" />
12+
<PackageReference Include="Atc" Version="2.0.251" />
13+
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Atc.CodingRules.AnalyzerProviders/Providers/AsyncFixerProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public AsyncFixerProvider(
1313

1414
public static string Name => "AsyncFixer";
1515

16-
public override Uri? DocumentationLink { get; set; } = new ("https://github.com/semihokur/AsyncFixer/blob/main/README.md", UriKind.Absolute);
16+
public override Uri? DocumentationLink { get; set; } = new("https://github.com/semihokur/AsyncFixer/blob/main/README.md", UriKind.Absolute);
1717

1818
protected override AnalyzerProviderBaseRuleData CreateData()
19-
=> new (Name);
19+
=> new(Name);
2020

2121
protected override async Task ReCollect(
2222
AnalyzerProviderBaseRuleData data)

src/Atc.CodingRules.AnalyzerProviders/Providers/AsyncifyProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public AsyncifyProvider(
1616

1717
public static string Name => "Asyncify";
1818

19-
public override Uri? DocumentationLink { get; set; } = new ("https://github.com/hvanbakel/Asyncify-CSharp", UriKind.Absolute);
19+
public override Uri? DocumentationLink { get; set; } = new("https://github.com/hvanbakel/Asyncify-CSharp", UriKind.Absolute);
2020

2121
protected override AnalyzerProviderBaseRuleData CreateData()
22-
=> new (Name);
22+
=> new(Name);
2323

2424
protected override async Task ReCollect(
2525
AnalyzerProviderBaseRuleData data)

src/Atc.CodingRules.AnalyzerProviders/Providers/MeziantouProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public MeziantouProvider(
1717

1818
public static string Name => "Meziantou.Analyzer";
1919

20-
public override Uri? DocumentationLink { get; set; } = new ("https://github.com/meziantou/Meziantou.Analyzer/tree/main/docs", UriKind.Absolute);
20+
public override Uri? DocumentationLink { get; set; } = new("https://github.com/meziantou/Meziantou.Analyzer/tree/main/docs", UriKind.Absolute);
2121

2222
protected override AnalyzerProviderBaseRuleData CreateData()
23-
=> new (Name);
23+
=> new(Name);
2424

2525
protected override async Task ReCollect(
2626
AnalyzerProviderBaseRuleData data)

0 commit comments

Comments
 (0)