Skip to content

Commit 6cfadc1

Browse files
committed
Add editorconfig
1 parent 05a0434 commit 6cfadc1

1 file changed

Lines changed: 174 additions & 0 deletions

File tree

.editorconfig

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
root = true
2+
3+
# All files
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
# C# source files
13+
[*.cs]
14+
indent_size = 2
15+
16+
#### C# Coding Conventions ####
17+
18+
# Organize usings
19+
dotnet_sort_system_directives_first = true
20+
dotnet_separate_import_directive_groups = false
21+
22+
# this. and Me. preferences
23+
dotnet_style_qualification_for_field = false:silent
24+
dotnet_style_qualification_for_property = false:silent
25+
dotnet_style_qualification_for_method = false:silent
26+
dotnet_style_qualification_for_event = false:silent
27+
28+
# Language keywords vs BCL types preferences
29+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
30+
dotnet_style_predefined_type_for_member_access = true:suggestion
31+
32+
# Modifier preferences
33+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
34+
dotnet_style_readonly_field = true:suggestion
35+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
36+
37+
# Parentheses preferences
38+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
39+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
40+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
41+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
42+
43+
# Expression-level preferences
44+
dotnet_style_object_initializer = true:suggestion
45+
dotnet_style_collection_initializer = true:suggestion
46+
dotnet_style_explicit_tuple_names = true:suggestion
47+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
48+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
49+
dotnet_style_prefer_auto_properties = true:suggestion
50+
dotnet_style_prefer_conditional_expression_over_assignment = false:silent
51+
dotnet_style_prefer_conditional_expression_over_return = false:silent
52+
dotnet_style_prefer_compound_assignment = true:suggestion
53+
54+
# Null-checking preferences
55+
dotnet_style_coalesce_expression = true:suggestion
56+
dotnet_style_null_propagation = true:suggestion
57+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
58+
59+
# C# Code Style Rules
60+
61+
# var preferences
62+
csharp_style_var_for_built_in_types = false:silent
63+
csharp_style_var_when_type_is_apparent = true:suggestion
64+
csharp_style_var_elsewhere = false:silent
65+
66+
# Expression-bodied members
67+
csharp_style_expression_bodied_methods = when_on_single_line:silent
68+
csharp_style_expression_bodied_constructors = false:silent
69+
csharp_style_expression_bodied_operators = when_on_single_line:silent
70+
csharp_style_expression_bodied_properties = true:suggestion
71+
csharp_style_expression_bodied_indexers = true:suggestion
72+
csharp_style_expression_bodied_accessors = true:suggestion
73+
csharp_style_expression_bodied_lambdas = true:suggestion
74+
csharp_style_expression_bodied_local_functions = when_on_single_line:silent
75+
76+
# Pattern matching preferences
77+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
78+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
79+
csharp_style_prefer_switch_expression = false:silent
80+
csharp_style_prefer_pattern_matching = true:silent
81+
csharp_style_prefer_not_pattern = true:suggestion
82+
83+
# Null-checking preferences
84+
csharp_style_throw_expression = false:silent
85+
csharp_style_conditional_delegate_call = true:suggestion
86+
87+
# Code block preferences
88+
csharp_prefer_braces = true:silent
89+
csharp_prefer_simple_using_statement = false:silent
90+
91+
# Expression preferences
92+
csharp_prefer_simple_default_expression = true:suggestion
93+
csharp_style_prefer_index_operator = false:silent
94+
csharp_style_prefer_range_operator = false:silent
95+
csharp_style_implicit_object_creation_when_type_is_apparent = false:silent
96+
csharp_style_prefer_tuple_swap = true:suggestion
97+
csharp_style_inlined_variable_declaration = true:suggestion
98+
csharp_style_deconstructed_variable_declaration = true:suggestion
99+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
100+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
101+
102+
# 'using' directive preferences
103+
csharp_using_directive_placement = outside_namespace:suggestion
104+
105+
# Namespace preferences
106+
csharp_style_namespace_declarations = file_scoped:silent
107+
108+
#### C# Formatting Rules ####
109+
110+
# New line preferences
111+
csharp_new_line_before_open_brace = all
112+
csharp_new_line_before_else = true
113+
csharp_new_line_before_catch = true
114+
csharp_new_line_before_finally = true
115+
csharp_new_line_before_members_in_object_initializers = true
116+
csharp_new_line_before_members_in_anonymous_types = true
117+
csharp_new_line_between_query_expression_clauses = true
118+
119+
# Indentation preferences
120+
csharp_indent_case_contents = true
121+
csharp_indent_switch_labels = true
122+
csharp_indent_labels = no_change
123+
csharp_indent_block_contents = true
124+
csharp_indent_braces = false
125+
csharp_indent_case_contents_when_block = false
126+
127+
# Space preferences
128+
csharp_space_after_cast = false
129+
csharp_space_after_keywords_in_control_flow_statements = true
130+
csharp_space_between_parentheses = false
131+
csharp_space_before_colon_in_inheritance_clause = true
132+
csharp_space_after_colon_in_inheritance_clause = true
133+
csharp_space_around_binary_operators = before_and_after
134+
csharp_space_between_method_declaration_parameter_list_parentheses = false
135+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
136+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
137+
csharp_space_between_method_call_parameter_list_parentheses = false
138+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
139+
csharp_space_between_method_call_name_and_opening_parenthesis = false
140+
csharp_space_after_comma = true
141+
csharp_space_before_comma = false
142+
csharp_space_after_dot = false
143+
csharp_space_before_dot = false
144+
csharp_space_after_semicolon_in_for_statement = true
145+
csharp_space_before_semicolon_in_for_statement = false
146+
csharp_space_around_declaration_statements = false
147+
csharp_space_before_open_square_brackets = false
148+
csharp_space_between_empty_square_brackets = false
149+
csharp_space_between_square_brackets = false
150+
151+
# Wrap preferences
152+
csharp_preserve_single_line_statements = false
153+
csharp_preserve_single_line_blocks = true
154+
155+
# Project files
156+
[*.{csproj,props,targets}]
157+
indent_size = 2
158+
159+
# Markdown files
160+
[*.md]
161+
trim_trailing_whitespace = false
162+
max_line_length = off
163+
164+
# Solution files
165+
[*.sln]
166+
indent_style = tab
167+
168+
# JSON files
169+
[*.json]
170+
indent_size = 2
171+
172+
# YAML files
173+
[*.{yml,yaml}]
174+
indent_size = 2

0 commit comments

Comments
 (0)