Skip to content

Commit 519a7ec

Browse files
committed
Added editorConfig - fixes #42
1 parent c3e9144 commit 519a7ec

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed

.editorconfig

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

Fritz.InstantAPIs.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
1414
EndProject
1515
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C73968E9-8A12-401C-BA5D-127C6D5A55D6}"
1616
ProjectSection(SolutionItems) = preProject
17+
.editorconfig = .editorconfig
1718
CODE-OF-CONDUCT.md = CODE-OF-CONDUCT.md
1819
CONTRIBUTING.md = CONTRIBUTING.md
1920
EndProjectSection

0 commit comments

Comments
 (0)