Skip to content

Commit f9d64ae

Browse files
authored
Create .editorconfig (#15)
1 parent d59bdd9 commit f9d64ae

File tree

1 file changed

+213
-0
lines changed

1 file changed

+213
-0
lines changed

Diff for: .editorconfig

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
[*]
5+
insert_final_newline = true
6+
indent_style = space
7+
trim_trailing_whitespace = true
8+
9+
# C# files
10+
[*.cs]
11+
12+
# Indentation and spacing
13+
indent_size = 4
14+
15+
# New line preferences
16+
csharp_new_line_before_catch = true
17+
csharp_new_line_before_else = true
18+
csharp_new_line_before_finally = true
19+
csharp_new_line_before_members_in_anonymous_types = true
20+
csharp_new_line_before_members_in_object_initializers = true
21+
csharp_new_line_before_open_brace = all
22+
csharp_new_line_between_query_expression_clauses = true
23+
24+
# Indentation preferences
25+
csharp_indent_block_contents = true
26+
csharp_indent_braces = false
27+
csharp_indent_case_contents = true
28+
csharp_indent_case_contents_when_block = true
29+
csharp_indent_labels = one_less_than_current
30+
csharp_indent_switch_labels = true
31+
32+
# Modifier preferences
33+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
34+
35+
# this. and Me. preferences
36+
dotnet_style_qualification_for_event = false:suggestion
37+
dotnet_style_qualification_for_field = false:suggestion
38+
dotnet_style_qualification_for_method = false:suggestion
39+
dotnet_style_qualification_for_property = false:suggestion
40+
41+
# var preferences
42+
csharp_style_var_for_built_in_types = false:suggestion
43+
csharp_style_var_when_type_is_apparent = true:suggestion
44+
csharp_style_var_elsewhere = false:suggestion
45+
46+
# Language keywords vs BCL types preferences
47+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
48+
dotnet_style_predefined_type_for_member_access = true:suggestion
49+
50+
# Naming rules
51+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
52+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
53+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
54+
55+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
56+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
57+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
58+
59+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
60+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
61+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
62+
63+
# name all constant fields using PascalCase
64+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
65+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
66+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
67+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
68+
dotnet_naming_symbols.constant_fields.required_modifiers = const
69+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
70+
71+
# static fields should have s_ prefix
72+
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
73+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
74+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
75+
dotnet_naming_symbols.static_fields.applicable_kinds = field
76+
dotnet_naming_symbols.static_fields.required_modifiers = static
77+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
78+
dotnet_naming_style.static_prefix_style.required_prefix = s_
79+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
80+
81+
# internal and private fields should be _camelCase
82+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
83+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
84+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
85+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
86+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
87+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
88+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
89+
90+
dotnet_naming_symbols.interface.applicable_kinds = interface
91+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
92+
dotnet_naming_symbols.interface.required_modifiers =
93+
94+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
95+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
96+
dotnet_naming_symbols.types.required_modifiers =
97+
98+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
99+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
100+
dotnet_naming_symbols.non_field_members.required_modifiers =
101+
102+
# Code style defaults
103+
csharp_using_directive_placement = outside_namespace:suggestion
104+
dotnet_sort_system_directives_first = true
105+
csharp_prefer_braces = true:silent
106+
csharp_preserve_single_line_blocks = true:none
107+
csharp_preserve_single_line_statements = false:none
108+
csharp_prefer_static_local_function = true:suggestion
109+
csharp_prefer_simple_using_statement = true:suggestion
110+
csharp_style_prefer_switch_expression = true:suggestion
111+
112+
# Code quality
113+
dotnet_style_readonly_field = true:suggestion
114+
dotnet_code_quality_unused_parameters = all:suggestion
115+
116+
# Expression-level preferences
117+
dotnet_style_coalesce_expression = true:suggestion
118+
dotnet_style_collection_initializer = true:suggestion
119+
dotnet_style_explicit_tuple_names = true:suggestion
120+
dotnet_style_null_propagation = true:suggestion
121+
dotnet_style_object_initializer = true:suggestion
122+
dotnet_style_prefer_auto_properties = true:suggestion
123+
dotnet_style_prefer_compound_assignment = true:suggestion
124+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
125+
dotnet_style_prefer_conditional_expression_over_return = true:silent
126+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
127+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
128+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
129+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
130+
dotnet_style_prefer_simplified_interpolation = true:suggestions
131+
csharp_prefer_simple_default_expression = true:suggestion
132+
133+
# Expression-bodied members
134+
csharp_style_expression_bodied_accessors = true:silent
135+
csharp_style_expression_bodied_constructors = true:silent
136+
csharp_style_expression_bodied_indexers = true:silent
137+
csharp_style_expression_bodied_lambdas = true:silent
138+
csharp_style_expression_bodied_local_functions = true:silent
139+
csharp_style_expression_bodied_methods = true:silent
140+
csharp_style_expression_bodied_operators = true:silent
141+
csharp_style_expression_bodied_properties = true:silent
142+
143+
# Pattern matching preferences
144+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
145+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
146+
csharp_style_prefer_switch_expression = true:suggestion
147+
148+
# Null checking preferences
149+
csharp_style_throw_expression = true:suggestion
150+
csharp_style_conditional_delegate_call = true:suggestion
151+
152+
# Space preferences
153+
csharp_space_after_cast = false
154+
csharp_space_after_colon_in_inheritance_clause = true
155+
csharp_space_after_comma = true
156+
csharp_space_after_dot = false
157+
csharp_space_after_keywords_in_control_flow_statements = true
158+
csharp_space_after_semicolon_in_for_statement = true
159+
csharp_space_around_binary_operators = before_and_after
160+
csharp_space_around_declaration_statements = false
161+
csharp_space_before_colon_in_inheritance_clause = true
162+
csharp_space_before_comma = false
163+
csharp_space_before_dot = false
164+
csharp_space_before_open_square_brackets = false
165+
csharp_space_before_semicolon_in_for_statement = false
166+
csharp_space_between_empty_square_brackets = false
167+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
168+
csharp_space_between_method_call_name_and_opening_parenthesis = false
169+
csharp_space_between_method_call_parameter_list_parentheses = false
170+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
171+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
172+
csharp_space_between_method_declaration_parameter_list_parentheses = false
173+
csharp_space_between_parentheses = false
174+
csharp_space_between_square_brackets = false
175+
176+
177+
# IDE0055: Fix formatting
178+
dotnet_diagnostic.IDE0055.severity = warning
179+
180+
181+
# Organize usings
182+
dotnet_separate_import_directive_groups = false
183+
file_header_template = unset
184+
185+
# Parentheses preferences
186+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
187+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
188+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
189+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
190+
191+
# Modifier preferences
192+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
193+
194+
195+
# Expression-level preferences
196+
csharp_style_deconstructed_variable_declaration = true:suggestion
197+
csharp_style_inlined_variable_declaration = true:suggestion
198+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
199+
csharp_style_prefer_index_operator = true:suggestion
200+
csharp_style_prefer_range_operator = true:suggestion
201+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
202+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
203+
204+
# Naming styles
205+
dotnet_naming_style.pascal_case.required_prefix =
206+
dotnet_naming_style.pascal_case.required_suffix =
207+
dotnet_naming_style.pascal_case.word_separator =
208+
dotnet_naming_style.pascal_case.capitalization = pascal_case
209+
210+
dotnet_naming_style.begins_with_i.required_prefix = I
211+
dotnet_naming_style.begins_with_i.required_suffix =
212+
dotnet_naming_style.begins_with_i.word_separator =
213+
dotnet_naming_style.begins_with_i.capitalization = pascal_case

0 commit comments

Comments
 (0)