Skip to content

Commit 7e9cceb

Browse files
authored
V1.2.2 (#197)
* refactor: update .editorconfig and workflow formatting rules * refactor: update .editorconfig for improved consistency
1 parent 545f924 commit 7e9cceb

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

.editorconfig

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1+
# EditorConfig is awesome: https://editorconfig.org
2+
# IDE0055 reports many issues related to spaces and line breaks, so it is disabled.
3+
4+
# top-most EditorConfig file
15
root = true
26

7+
# General
38
[*]
49
charset = utf-8
510
end_of_line = lf
6-
trim_trailing_whitespace = false
7-
insert_final_newline = false
11+
insert_final_newline = true
812
indent_style = space
913
indent_size = 2
1014

11-
[{appsettings.json,appsettings.*.json}]
12-
charset = utf-8-bom
13-
indent_style = space
14-
indent_size = 4
15-
1615
[*.cs]
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
1718
indent_style = space
1819
indent_size = 4
1920
tab_width = 4
2021

21-
# StyleCop Diagnostic Rules =================
22-
2322
# Always insert a newline before opening braces '{'
24-
csharp_new_line_before_open_brace = methods, properties, control_blocks, types
25-
# Display multiple statements and member declarations on a single line
26-
csharp_preserve_single_line_statements = false
27-
# Allow code blocks to remain on a single line if they fit
28-
csharp_preserve_single_line_blocks = true
23+
csharp_new_line_before_open_brace = all
24+
2925
# switch case Indent the content.
3026
csharp_indent_case_contents = true
3127
# Indent switch label
@@ -38,12 +34,13 @@ csharp_indent_block_contents = true
3834
csharp_indent_braces = false
3935
# Indent the statement list and curly braces in the case of a switch statement.
4036
csharp_indent_case_contents_when_block = false
37+
4138
# Insert spaces after cast operators
4239
csharp_space_after_cast = true
4340
# Insert a space after control flow keywords ('if', 'while', 'for', etc.)
4441
csharp_space_after_keywords_in_control_flow_statements = true
4542
# Do not insert spaces within parentheses '()'
46-
csharp_space_between_parentheses = control_flow_statements
43+
csharp_space_between_parentheses = false
4744
# Insert a space before colons ':' in inheritance clauses
4845
csharp_space_before_colon_in_inheritance_clause = true
4946
# Insert spaces after colons ':' in inheritance clauses
@@ -80,12 +77,19 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
8077
csharp_space_between_method_declaration_parameter_list_parentheses = false
8178
# Do not insert spaces within square brackets '[]'
8279
csharp_space_between_square_brackets = false
80+
81+
# Display multiple statements and member declarations on a single line
82+
csharp_preserve_single_line_statements = false
83+
# Allow code blocks to remain on a single line if they fit
84+
csharp_preserve_single_line_blocks = true
85+
8386
# Recommend using type inference ('var') for variable declarations
8487
csharp_style_var_elsewhere = true:suggestion
8588
# Recommend using type inference ('var') for built-in types (e.g., 'int')
8689
csharp_style_var_for_built_in_types = true:suggestion
8790
# Recommend using type inference ('var') when the type is apparent
8891
csharp_style_var_when_type_is_apparent = true:suggestion
92+
8993
# Always use braces for control structures
9094
csharp_prefer_braces = true:warning
9195
csharp_prefer_simple_using_statement = true:warning
@@ -101,7 +105,6 @@ dotnet_style_qualification_for_method = false:suggestion
101105
# Avoid requiring explicit qualifiers (e.g., `this.`) when accessing properties.
102106
dotnet_style_qualification_for_property = false:suggestion
103107

104-
# StyleCop Diagnostic Rules =================
105108

106109
# Add braces (`{}`) to if or while statements
107110
dotnet_diagnostic.IDE0011.severity = warning
@@ -236,6 +239,7 @@ dotnet_diagnostic.SA9001.severity = none
236239
# Reserved for custom or experimental rules.
237240
dotnet_diagnostic.SA9002.severity = none
238241

242+
239243
# C# Naming Rules (Classes and Interfaces) =================
240244

241245
# Public classes

.github/workflows/reusable-lint-cs-files.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
}
153153
print
154154
}')
155-
155+
156156
output=$(echo "$output" | awk '{
157157
if (match($0, /\\n+/)) {
158158
count = gsub(/\\n/, "newline ↵")

0 commit comments

Comments
 (0)