Skip to content

Commit 7040516

Browse files
authored
Create .editorconfig
1 parent 0e3ad77 commit 7040516

1 file changed

Lines changed: 223 additions & 0 deletions

File tree

.editorconfig

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
[*.cs]
2+
3+
#Core editorconfig formatting - indentation
4+
5+
#use soft tabs (spaces) for indentation
6+
indent_style = space
7+
8+
#Formatting - new line options
9+
10+
#place catch statements on a new line
11+
csharp_new_line_before_catch = true
12+
#place else statements on a new line
13+
csharp_new_line_before_else = true
14+
#require members of anonymous types to be on the same line
15+
csharp_new_line_before_members_in_anonymous_types = false
16+
#require members of object initializers to be on the same line
17+
csharp_new_line_before_members_in_object_initializers = false
18+
#require braces to be on a new line for object_collection_array_initializers, methods, control_blocks, types, and lambdas (also known as "Allman" style)
19+
csharp_new_line_before_open_brace = object_collection_array_initializers, methods, control_blocks, types, lambdas
20+
21+
#Formatting - organize using options
22+
23+
#do not place System.* using directives before other using directives
24+
dotnet_sort_system_directives_first = false
25+
26+
#Formatting - spacing options
27+
28+
#require NO space between a cast and the value
29+
csharp_space_after_cast = false
30+
#require a space before the colon for bases or interfaces in a type declaration
31+
csharp_space_after_colon_in_inheritance_clause = true
32+
#require a space after a keyword in a control flow statement such as a for loop
33+
csharp_space_after_keywords_in_control_flow_statements = true
34+
#require a space before the colon for bases or interfaces in a type declaration
35+
csharp_space_before_colon_in_inheritance_clause = true
36+
#remove space within empty argument list parentheses
37+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
38+
#remove space between method call name and opening parenthesis
39+
csharp_space_between_method_call_name_and_opening_parenthesis = false
40+
#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
41+
csharp_space_between_method_call_parameter_list_parentheses = false
42+
#remove space within empty parameter list parentheses for a method declaration
43+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
44+
#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
45+
csharp_space_between_method_declaration_parameter_list_parentheses = false
46+
47+
#Formatting - wrapping options
48+
49+
#leave code block on single line
50+
csharp_preserve_single_line_blocks = true
51+
#leave statements and member declarations on the same line
52+
csharp_preserve_single_line_statements = true
53+
54+
#Style - Code block preferences
55+
56+
#prefer no curly braces if allowed
57+
csharp_prefer_braces = false:suggestion
58+
59+
#Style - expression bodied member options
60+
61+
#prefer block bodies for constructors
62+
csharp_style_expression_bodied_constructors = false:suggestion
63+
#prefer expression-bodied members for methods
64+
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
65+
#prefer expression-bodied members for properties
66+
csharp_style_expression_bodied_properties = true:suggestion
67+
68+
#Style - expression level options
69+
70+
#prefer out variables to be declared inline in the argument list of a method call when possible
71+
csharp_style_inlined_variable_declaration = true:suggestion
72+
#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
73+
dotnet_style_predefined_type_for_member_access = true:suggestion
74+
75+
#Style - Expression-level preferences
76+
77+
#prefer default over default(T)
78+
csharp_prefer_simple_default_expression = true:suggestion
79+
#prefer objects to be initialized using object initializers when possible
80+
dotnet_style_object_initializer = true:suggestion
81+
#prefer inferred anonymous type member names
82+
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
83+
#prefer inferred tuple element names
84+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
85+
86+
#Style - implicit and explicit types
87+
88+
#prefer var over explicit type in all cases, unless overridden by another code style rule
89+
csharp_style_var_elsewhere = true:suggestion
90+
#prefer var is used to declare variables with built-in system types such as int
91+
csharp_style_var_for_built_in_types = true:suggestion
92+
#prefer var when the type is already mentioned on the right-hand side of a declaration expression
93+
csharp_style_var_when_type_is_apparent = true:suggestion
94+
95+
#Style - language keyword and framework type options
96+
97+
#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
98+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
99+
100+
#Style - Miscellaneous preferences
101+
102+
#prefer local functions over anonymous functions
103+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
104+
105+
#Style - modifier options
106+
107+
#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.
108+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
109+
110+
#Style - Modifier preferences
111+
112+
#when this rule is set to a list of modifiers, prefer the specified ordering.
113+
csharp_preferred_modifier_order = public,protected,private,internal,static,async,abstract,virtual,readonly,sealed,override:suggestion
114+
115+
#Style - Pattern matching
116+
117+
#prefer pattern matching instead of is expression with type casts
118+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
119+
120+
#Style - qualification options
121+
122+
#prefer fields not to be prefaced with this. or Me. in Visual Basic
123+
dotnet_style_qualification_for_field = false:suggestion
124+
#prefer methods not to be prefaced with this. or Me. in Visual Basic
125+
dotnet_style_qualification_for_method = false:suggestion
126+
#prefer properties not to be prefaced with this. or Me. in Visual Basic
127+
dotnet_style_qualification_for_property = false:suggestion
128+
csharp_indent_labels = no_change
129+
csharp_using_directive_placement = outside_namespace:silent
130+
csharp_prefer_simple_using_statement = true:suggestion
131+
csharp_style_namespace_declarations = file_scoped:silent
132+
csharp_style_expression_bodied_operators = false:silent
133+
csharp_style_expression_bodied_indexers = true:silent
134+
csharp_style_expression_bodied_accessors = true:silent
135+
csharp_style_expression_bodied_lambdas = true:silent
136+
csharp_style_expression_bodied_local_functions = false:silent
137+
csharp_style_throw_expression = true:suggestion
138+
csharp_style_prefer_null_check_over_type_check = true:suggestion
139+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
140+
csharp_style_prefer_index_operator = true:suggestion
141+
csharp_style_prefer_range_operator = true:suggestion
142+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
143+
csharp_style_prefer_tuple_swap = true:suggestion
144+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
145+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:suggestion
146+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
147+
csharp_style_prefer_extended_property_pattern = true:suggestion
148+
149+
[*.{cs,vb}]
150+
#### Naming styles ####
151+
152+
# Naming rules
153+
154+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
155+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
156+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
157+
158+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
159+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
160+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
161+
162+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
163+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
164+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
165+
166+
# Symbol specifications
167+
168+
dotnet_naming_symbols.interface.applicable_kinds = interface
169+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
170+
dotnet_naming_symbols.interface.required_modifiers =
171+
172+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
173+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
174+
dotnet_naming_symbols.types.required_modifiers =
175+
176+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
177+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
178+
dotnet_naming_symbols.non_field_members.required_modifiers =
179+
180+
# Naming styles
181+
182+
dotnet_naming_style.begins_with_i.required_prefix = I
183+
dotnet_naming_style.begins_with_i.required_suffix =
184+
dotnet_naming_style.begins_with_i.word_separator =
185+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
186+
187+
dotnet_naming_style.pascal_case.required_prefix =
188+
dotnet_naming_style.pascal_case.required_suffix =
189+
dotnet_naming_style.pascal_case.word_separator =
190+
dotnet_naming_style.pascal_case.capitalization = pascal_case
191+
192+
dotnet_naming_style.pascal_case.required_prefix =
193+
dotnet_naming_style.pascal_case.required_suffix =
194+
dotnet_naming_style.pascal_case.word_separator =
195+
dotnet_naming_style.pascal_case.capitalization = pascal_case
196+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
197+
tab_width = 4
198+
indent_size = 4
199+
end_of_line = crlf
200+
dotnet_style_coalesce_expression = true:suggestion
201+
dotnet_style_null_propagation = true:suggestion
202+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
203+
dotnet_style_prefer_auto_properties = true:silent
204+
dotnet_style_object_initializer = true:suggestion
205+
dotnet_style_collection_initializer = true:suggestion
206+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
207+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
208+
dotnet_style_prefer_conditional_expression_over_return = true:silent
209+
dotnet_style_explicit_tuple_names = true:suggestion
210+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
211+
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
212+
dotnet_style_prefer_compound_assignment = true:suggestion
213+
dotnet_style_prefer_simplified_interpolation = true:suggestion
214+
dotnet_style_namespace_match_folder = true:suggestion
215+
dotnet_diagnostic.CA2007.severity = silent
216+
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
217+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
218+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
219+
dotnet_style_predefined_type_for_member_access = true:suggestion
220+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
221+
dotnet_style_qualification_for_field = false:suggestion
222+
dotnet_style_qualification_for_property = false:suggestion
223+
dotnet_style_qualification_for_method = false:suggestion

0 commit comments

Comments
 (0)