1
- # Rules in this file were initially inferred by Visual Studio IntelliCode from the S:\src\gh\jk\tip-calc\src codebase based on best match to current usage at 11/9/2021
2
- # You can modify the rules from these initially generated values to suit your own policies
3
- # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
4
- [* .cs ]
5
-
1
+ # To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2
+ # better ref located at: https://kent-boogaart.com/blog/editorconfig-reference-for-c-developers
6
3
7
- # Core editorconfig formatting - indentation
4
+ # -- All Files ------------------------------------------ #
8
5
9
- # use soft tabs (spaces) for indentation
6
+ [ * ]
10
7
indent_style = space
11
8
12
- # Formatting - new line options
9
+ # -- .NET Files ----------------------------------------- #
10
+
11
+ [* .{cs,csx,vb,vbx} ]
12
+ charset = utf-8-bom
13
+ end_of_line = crlf
14
+ indent_size = 4
15
+ insert_final_newline = true
16
+ trim_trailing_whitespace = true
17
+
18
+ [* .{cs,vb} ]
19
+ # Organize usings and namespaces
20
+ dotnet_sort_system_directives_first = true
21
+ csharp_style_namespace_declarations = file_scoped:suggestion
22
+
23
+ # this. and me. preferences
24
+ dotnet_style_qualification_for_event = true :warning
25
+ dotnet_style_qualification_for_field = true :warning
26
+ dotnet_style_qualification_for_method = true :warning
27
+ dotnet_style_qualification_for_property = true :warning
28
+
29
+ # Parentheses preferences
30
+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
31
+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
32
+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
33
+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
34
+
35
+ # Language keywords instead of framework type names for type references
36
+ dotnet_style_predefined_type_for_locals_parameters_members = true :warning
37
+ dotnet_style_predefined_type_for_member_access = true :warning
38
+
39
+ # null check preferences
40
+ dotnet_style_coalesce_expression = true :warning
41
+ dotnet_style_null_propagation = true :warning
42
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
43
+
44
+ dotnet_style_collection_initializer = true :warning
45
+ dotnet_style_explicit_tuple_names = true :warning
46
+ dotnet_style_object_initializer = true :warning
47
+ dotnet_style_prefer_auto_properties = true :warning
48
+ dotnet_style_prefer_conditional_expression_over_assignment = true :warning
49
+ dotnet_style_prefer_conditional_expression_over_return = true :warning
50
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
51
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
52
+ dotnet_style_readonly_field = true :warning
53
+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
54
+
55
+ # -- .NET Naming Conventions ---------------------------- #
56
+
57
+ dotnet_naming_symbols.private_field_symbol.applicable_kinds = field
58
+ dotnet_naming_symbols.private_field_symbol.applicable_accessibilities = private
59
+ dotnet_naming_style.private_field_style.capitalization = camel_case
60
+ dotnet_naming_rule.private_fields_are_camel_case.severity = warning
61
+ dotnet_naming_rule.private_fields_are_camel_case.symbols = private_field_symbol
62
+ dotnet_naming_rule.private_fields_are_camel_case.style = private_field_style
63
+
64
+ dotnet_naming_symbols.non_private_field_symbol.applicable_kinds = field
65
+ dotnet_naming_symbols.non_private_field_symbol.applicable_accessibilities = public,internal,friend,protected,protected_internal,protected_friend
66
+ dotnet_naming_style.non_private_field_style.capitalization = pascal_case
67
+ dotnet_naming_rule.non_private_fields_are_pascal_case.severity = warning
68
+ dotnet_naming_rule.non_private_fields_are_pascal_case.symbols = non_private_field_symbol
69
+ dotnet_naming_rule.non_private_fields_are_pascal_case.style = non_private_field_style
70
+
71
+ dotnet_naming_symbols.parameter_symbol.applicable_kinds = parameter
72
+ dotnet_naming_style.parameter_style.capitalization = camel_case
73
+ dotnet_naming_rule.parameters_are_camel_case.severity = warning
74
+ dotnet_naming_rule.parameters_are_camel_case.symbols = parameter_symbol
75
+ dotnet_naming_rule.parameters_are_camel_case.style = parameter_style
76
+
77
+ dotnet_naming_symbols.non_interface_type_symbol.applicable_kinds = class,struct,enum,delegate
78
+ dotnet_naming_style.non_interface_type_style.capitalization = pascal_case
79
+ dotnet_naming_rule.non_interface_types_are_pascal_case.severity = warning
80
+ dotnet_naming_rule.non_interface_types_are_pascal_case.symbols = non_interface_type_symbol
81
+ dotnet_naming_rule.non_interface_types_are_pascal_case.style = non_interface_type_style
82
+
83
+ dotnet_naming_symbols.interface_type_symbol.applicable_kinds = interface
84
+ dotnet_naming_style.interface_type_style.capitalization = pascal_case
85
+ dotnet_naming_style.interface_type_style.required_prefix = I
86
+ dotnet_naming_rule.interface_types_must_be_prefixed_with_I.severity = warning
87
+ dotnet_naming_rule.interface_types_must_be_prefixed_with_I.symbols = interface_type_symbol
88
+ dotnet_naming_rule.interface_types_must_be_prefixed_with_I.style = interface_type_style
89
+
90
+ dotnet_naming_symbols.member_symbol.applicable_kinds = method,property,event
91
+ dotnet_naming_style.member_style.capitalization = pascal_case
92
+ dotnet_naming_rule.members_are_pascal_case.severity = warning
93
+ dotnet_naming_rule.members_are_pascal_case.symbols = member_symbol
94
+ dotnet_naming_rule.members_are_pascal_case.style = member_style
95
+
96
+ # -- C# Files ------------------------------------------- #
13
97
14
- # require members of object intializers to be on separate lines
98
+ [* .cs ]
99
+ # var preferences
100
+ csharp_style_var_elsewhere = true :warning
101
+ csharp_style_var_for_built_in_types = true :warning
102
+ csharp_style_var_when_type_is_apparent = true :warning
103
+
104
+ # Expression-bodied members
105
+ csharp_style_expression_bodied_accessors = true :warning
106
+ csharp_style_expression_bodied_constructors = false :warning
107
+ csharp_style_expression_bodied_indexers = true :warning
108
+ csharp_style_expression_bodied_methods = true :warning
109
+ csharp_style_expression_bodied_operators = true :warning
110
+ csharp_style_expression_bodied_properties = true :warning
111
+
112
+ # Pattern matching preferences
113
+ csharp_style_pattern_matching_over_as_with_null_check = true :warning
114
+ csharp_style_pattern_matching_over_is_with_cast_check = true :warning
115
+
116
+ # Null-checking preferences
117
+ csharp_style_throw_expression = true :warning
118
+ csharp_style_conditional_delegate_call = true :warning
119
+
120
+ # Expression-level preferences
121
+ csharp_prefer_braces = true :warning
122
+ csharp_prefer_simple_default_expression = true :warning
123
+ csharp_style_deconstructed_variable_declaration = true :warning
124
+ csharp_style_inlined_variable_declaration = true :warning
125
+ csharp_style_pattern_local_over_anonymous_function = false :suggestion
126
+
127
+ # Indentation preferences
128
+ csharp_indent_block_contents = true
129
+ csharp_indent_braces = false
130
+ csharp_indent_case_contents = true
131
+ csharp_indent_labels = flush_left
132
+ csharp_indent_switch_labels = true
133
+
134
+ # New line preferences
135
+ csharp_new_line_before_catch = true
136
+ csharp_new_line_before_else = true
137
+ csharp_new_line_before_finally = true
138
+ csharp_new_line_before_members_in_anonymous_types = true
15
139
csharp_new_line_before_members_in_object_initializers = true
140
+ csharp_new_line_before_open_brace = all
141
+ csharp_new_line_between_query_expression_clauses = true
16
142
17
- # Formatting - organize using options
18
-
19
- # do not place System.* using directives before other using directives
20
- dotnet_sort_system_directives_first = false
21
-
22
- # Formatting - spacing options
143
+ # Wrapping preferences
144
+ csharp_preserve_single_line_blocks = true
145
+ csharp_preserve_single_line_statements = false
23
146
24
- # require a space after a keyword in a control flow statement such as a for loop
147
+ # Space preferences
148
+ csharp_space_after_cast = false
149
+ csharp_space_after_colon_in_inheritance_clause = true
150
+ csharp_space_after_comma = true
151
+ csharp_space_after_dot = false
25
152
csharp_space_after_keywords_in_control_flow_statements = true
26
- # do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
153
+ csharp_space_after_semicolon_in_for_statement = true
154
+ csharp_space_around_binary_operators = before_and_after
155
+ csharp_space_around_declaration_statements = do_not_ignore
156
+ csharp_space_before_colon_in_inheritance_clause = true
157
+ csharp_space_before_comma = false
158
+ csharp_space_before_dot = false
159
+ csharp_space_before_open_square_brackets = false
160
+ csharp_space_before_semicolon_in_for_statement = false
161
+ csharp_space_between_empty_square_brackets = false
162
+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
163
+ csharp_space_between_method_call_name_and_opening_parenthesis = false
27
164
csharp_space_between_method_call_parameter_list_parentheses = false
28
- # place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
165
+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
166
+ csharp_space_between_method_declaration_name_and_open_parenthesis = false
29
167
csharp_space_between_method_declaration_parameter_list_parentheses = false
30
-
31
- # Formatting - wrapping options
32
-
33
- # leave code block on single line
34
- csharp_preserve_single_line_blocks = true
35
-
36
- # Style - Code block preferences
37
-
38
- # prefer curly braces even for one line of code
39
- csharp_prefer_braces = true :suggestion
40
-
41
- # Style - expression bodied member options
42
-
43
- # prefer expression-bodied members for accessors
44
- csharp_style_expression_bodied_accessors = true :suggestion
45
- # prefer block bodies for methods
46
- csharp_style_expression_bodied_methods = false :suggestion
47
- # prefer expression-bodied members for properties
48
- csharp_style_expression_bodied_properties = true :suggestion
49
-
50
- # Style - expression level options
51
-
52
- # prefer out variables to be declared inline in the argument list of a method call when possible
53
- csharp_style_inlined_variable_declaration = true :suggestion
54
- # prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
55
- dotnet_style_predefined_type_for_member_access = true :suggestion
56
-
57
- # Style - Expression-level preferences
58
-
59
- # prefer objects to be initialized using object initializers when possible
60
- dotnet_style_object_initializer = true :suggestion
61
-
62
- # Style - implicit and explicit types
63
-
64
- # prefer var over explicit type in all cases, unless overridden by another code style rule
65
- csharp_style_var_elsewhere = true :suggestion
66
- # prefer var when the type is already mentioned on the right-hand side of a declaration expression
67
- csharp_style_var_when_type_is_apparent = true :suggestion
68
-
69
- # Style - language keyword and framework type options
70
-
71
- # prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
72
- dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
73
-
74
- # Style - modifier options
75
-
76
- # prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.
77
- dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
78
-
79
- # Style - Modifier preferences
80
-
81
- # when this rule is set to a list of modifiers, prefer the specified ordering.
82
- csharp_preferred_modifier_order = public,protected,private,static,async,override:suggestion
83
-
84
- # Style - qualification options
85
-
86
- # prefer fields to be prefaced with this. in C# or Me. in Visual Basic
87
- dotnet_style_qualification_for_field = true :suggestion
88
- # prefer properties to be prefaced with this. in C# or Me. in Visual Basic
89
- dotnet_style_qualification_for_property = true :suggestion
90
- csharp_style_namespace_declarations =file_scoped:silent
168
+ csharp_space_between_parentheses = none
169
+ csharp_space_between_square_brackets = false
0 commit comments