Skip to content

Commit 3b23db2

Browse files
committed
Ensure contentGit is trimed for empty-lines-end and update file is also trimed for empty-lines-end
1 parent 0ad5c6b commit 3b23db2

File tree

7 files changed

+35
-17
lines changed

7 files changed

+35
-17
lines changed

.editorconfig

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2-
# Version: 1.0.7
3-
# Updated: 18-06-2021
2+
# Version: 1.0.9
3+
# Updated: 01-02-2022
44
# Location: Root
5+
# Distribution: DotNet6
56
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
67

78
##########################################
@@ -45,6 +46,7 @@ indent_size = 2
4546

4647
# Markdown Files
4748
[*.md]
49+
trim_trailing_whitespace = false
4850

4951
# Web Files
5052
[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}]
@@ -54,8 +56,13 @@ indent_size = 2
5456
[*.{cmd,bat}]
5557
end_of_line = crlf
5658

57-
# Shell scripts/files
58-
[*.{sh,ps1}]
59+
# Bash Files
60+
[*.sh]
61+
end_of_line = lf
62+
indent_size = 2
63+
64+
# Powershell
65+
[*.ps1]
5966
end_of_line = lf
6067
indent_size = 2
6168

@@ -487,6 +494,11 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
487494
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
488495

489496

497+
##########################################
498+
# Custom - File Extension Settings
499+
##########################################
500+
501+
490502
##########################################
491503
# Custom - Code Analyzers Rules
492504
##########################################

src/.editorconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2-
# Version: 1.0.5
3-
# Updated: 02-05-2021
4-
# Location: Src
2+
# Version: 1.0.9
3+
# Updated: 01-02-2022
4+
# Location: src
5+
# Distribution: DotNet6
56
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
67

78
##########################################
@@ -43,4 +44,5 @@
4344

4445
##########################################
4546
# Custom - Code Analyzers Rules
46-
##########################################dotnet_diagnostic.SA1204.severity = none # For now
47+
##########################################
48+
dotnet_diagnostic.SA1204.severity = none # For now

src/Atc.CodingRules.Updater/EditorConfigHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static void HandleFile(
4040
Directory.CreateDirectory(file.Directory.FullName);
4141
}
4242

43-
var contentGit = HttpClientHelper.GetAsString(logger, rawGitUrl);
43+
var contentGit = HttpClientHelper.GetAsString(logger, rawGitUrl).TrimEndForEmptyLines();
4444
var contentFile = FileHelper.ReadAllText(file);
4545

4646
HandleFile(logger, area, contentGit, contentFile, descriptionPart, file);
@@ -264,7 +264,10 @@ private static string BuildNewContentFile(string contentGitBasePart, List<Tuple<
264264
}
265265
}
266266

267-
var newContentFile = sbNewContentFile.ToString();
267+
var newContentFile = sbNewContentFile
268+
.ToString()
269+
.TrimEndForEmptyLines();
270+
268271
return newContentFile;
269272
}
270273

test/.editorconfig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2-
# Version: 1.0.7
3-
# Updated: 18-06-2021
4-
# Location: Test
2+
# Version: 1.0.9
3+
# Updated: 01-02-2022
4+
# Location: test
5+
# Distribution: DotNet6
56
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
67

78
##########################################
@@ -50,4 +51,4 @@ dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net
5051

5152
##########################################
5253
# Custom - Code Analyzers Rules
53-
####################################################################################
54+
##########################################

test/Atc.CodingRules.Updater.Tests/TestFilesDistribution/File_DotNet6_Root_1a.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,4 +502,4 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net
502502
# Custom - Code Analyzers Rules
503503
##########################################
504504
[*.{cs,csx,cake}]
505-
dotnet_diagnostic.SA1200.severity = error # ??
505+
dotnet_diagnostic.SA1200.severity = error # [Justification description]

test/Atc.CodingRules.Updater.Tests/TestFilesDistribution/Result_DotNet6_Root_1a.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,4 +502,4 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net
502502
##########################################
503503
# Custom - Code Analyzers Rules
504504
##########################################
505-
[*.{cs,csx,cake}]
505+
[*.{cs,csx,cake}]

test/Atc.CodingRules.Updater.Tests/TestFilesDistribution/Result_DotNet6_Root_1b.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,4 +503,4 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net
503503
# Custom - Code Analyzers Rules
504504
##########################################
505505
[*.{cs,csx,cake}]
506-
dotnet_diagnostic.SA1200.severity = error # ??
506+
dotnet_diagnostic.SA1200.severity = error # [Justification description]

0 commit comments

Comments
 (0)