1+ #  LAST REVISION: 08-12-2020
2+ 
3+ root  = true 
4+ 
5+ #  Don't use tabs for indentation.
6+ [* 
7+ indent_style  = space 
8+ #  (Please don't specify an indent_size here; that has too many unintended consequences.)
9+ 
10+ #  Code files
11+ [* .{cs,csx}
12+ indent_size  = 4 
13+ insert_final_newline  = true 
14+ charset  = utf-8-bom 
15+ 
16+ #  XML project files
17+ [* .{csproj,vcxproj,vcxproj.filters,proj,projitems,shproj}
18+ indent_size  = 2 
19+ 
20+ #  XML config files
21+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}
22+ indent_size  = 2 
23+ 
24+ #  JSON files
25+ [* .json
26+ indent_size  = 2 
27+ 
28+ #  Powershell files
29+ [* .ps1
30+ indent_size  = 2 
31+ 
32+ [* .cs
33+ #  Sort using and Import directives with System.* appearing first
34+ dotnet_sort_system_directives_first  = true 
35+ 
36+ #  Avoid "this." if not necessary
37+ dotnet_style_qualification_for_field  = false:refactoring 
38+ dotnet_style_qualification_for_property  = false:refactoring 
39+ dotnet_style_qualification_for_method  = false:refactoring 
40+ dotnet_style_qualification_for_event  = false:refactoring 
41+ 
42+ #  Use language keywords instead of framework type names for type references
43+ dotnet_style_predefined_type_for_locals_parameters_members  = true :suggestion 
44+ dotnet_style_predefined_type_for_member_access  = true :suggestion 
45+ 
46+ #  Suggest more modern language features when available
47+ dotnet_style_object_initializer  = true :suggestion 
48+ dotnet_style_collection_initializer  = true :suggestion 
49+ dotnet_style_coalesce_expression  = true :suggestion 
50+ dotnet_style_null_propagation  = true :suggestion 
51+ dotnet_style_explicit_tuple_names  = true :suggestion 
52+ 
53+ # #########################################
54+ #  Styles
55+ # #########################################
56+ 
57+ #  prefix_interface_with_i_style - Interfaces must be PascalCase and the first character of an interface must be an 'I'
58+ dotnet_naming_style.prefix_interface_with_i_style.capitalization  = pascal_case 
59+ dotnet_naming_style.prefix_interface_with_i_style.required_prefix  = I 
60+ 
61+ #  prefix_type_parameters_with_t_style - Generic Type Parameters must be PascalCase and the first character must be a 'T'
62+ dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization  = pascal_case 
63+ dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix  = T 
64+ 
65+ # ##########################################
66+ 
67+ #  Non-private static fields are PascalCase
68+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity  = error 
69+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols  = non_private_static_fields 
70+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style  = non_private_static_field_style 
71+ dotnet_naming_symbols.non_private_static_fields.applicable_kinds  = field 
72+ dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities  = public,  protected,  internal,  protected_internal,  private_protected 
73+ dotnet_naming_symbols.non_private_static_fields.required_modifiers  = static 
74+ dotnet_naming_style.non_private_static_field_style.capitalization  = pascal_case 
75+ 
76+ #  Non-private readonly fields are PascalCase
77+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity  = error 
78+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols  = non_private_readonly_fields 
79+ dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style  = non_private_readonly_field_style 
80+ dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds  = field 
81+ dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities  = public,  protected,  internal,  protected_internal,  private_protected 
82+ dotnet_naming_symbols.non_private_readonly_fields.required_modifiers  = readonly 
83+ dotnet_naming_style.non_private_readonly_field_style.capitalization  = pascal_case 
84+ 
85+ #  Constants are PascalCase
86+ dotnet_naming_rule.constants_should_be_pascal_case.severity  = error 
87+ dotnet_naming_rule.constants_should_be_pascal_case.symbols  = constants 
88+ dotnet_naming_rule.constants_should_be_pascal_case.style  = constant_style 
89+ dotnet_naming_symbols.constants.applicable_kinds  = field,  local 
90+ dotnet_naming_symbols.constants.required_modifiers  = const 
91+ dotnet_naming_style.constant_style.capitalization  = pascal_case 
92+ 
93+ #  Instance fields are camelCase and start with _
94+ dotnet_naming_rule.instance_fields_should_be_camel_case.severity  = error 
95+ dotnet_naming_rule.instance_fields_should_be_camel_case.symbols  = instance_fields 
96+ dotnet_naming_rule.instance_fields_should_be_camel_case.style  = instance_field_style 
97+ dotnet_naming_symbols.instance_fields.applicable_kinds  = field 
98+ dotnet_naming_style.instance_field_style.capitalization  = camel_case 
99+ dotnet_naming_style.instance_field_style.required_prefix  = _ 
100+ 
101+ #  Locals and parameters are camelCase
102+ dotnet_naming_rule.locals_should_be_camel_case.severity  = error 
103+ dotnet_naming_rule.locals_should_be_camel_case.symbols  = locals_and_parameters 
104+ dotnet_naming_rule.locals_should_be_camel_case.style  = camel_case_style 
105+ dotnet_naming_symbols.locals_and_parameters.applicable_kinds  = parameter,  local 
106+ dotnet_naming_style.camel_case_style.capitalization  = camel_case 
107+ 
108+ #  Local functions are PascalCase
109+ dotnet_naming_rule.local_functions_should_be_pascal_case.severity  = error 
110+ dotnet_naming_rule.local_functions_should_be_pascal_case.symbols  = local_functions 
111+ dotnet_naming_rule.local_functions_should_be_pascal_case.style  = local_function_style 
112+ dotnet_naming_symbols.local_functions.applicable_kinds  = local_function 
113+ dotnet_naming_style.local_function_style.capitalization  = pascal_case 
114+ 
115+ #  Interfaces use PascalCase and are prefixed with uppercase 'I'
116+ #  https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
117+ dotnet_naming_symbols.interface_group.applicable_kinds  = interface 
118+ dotnet_naming_rule.interface_rule.symbols  = interface_group 
119+ dotnet_naming_rule.interface_rule.style  = prefix_interface_with_i_style 
120+ dotnet_naming_rule.interface_rule.severity   = error 
121+ 
122+ #  Generics Type Parameters use PascalCase and are prefixed with uppercase 'T'
123+ #  https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
124+ dotnet_naming_symbols.type_parameter_group.applicable_kinds  = type_parameter 
125+ dotnet_naming_rule.type_parameter_rule.symbols  = type_parameter_group 
126+ dotnet_naming_rule.type_parameter_rule.style  = prefix_type_parameters_with_t_style 
127+ dotnet_naming_rule.type_parameter_rule.severity   = error 
128+ 
129+ #  By default, name items with PascalCase
130+ dotnet_naming_rule.members_should_be_pascal_case.severity  = error 
131+ dotnet_naming_rule.members_should_be_pascal_case.symbols  = all_members 
132+ dotnet_naming_rule.members_should_be_pascal_case.style  = pascal_case_style 
133+ dotnet_naming_symbols.all_members.applicable_kinds  = * 
134+ dotnet_naming_style.pascal_case_style.capitalization  = pascal_case 
135+ 
136+ #  Newline settings
137+ csharp_new_line_before_open_brace  = all 
138+ csharp_new_line_before_else  = true 
139+ csharp_new_line_before_catch  = true 
140+ csharp_new_line_before_finally  = true 
141+ csharp_new_line_before_members_in_object_initializers  = true 
142+ csharp_new_line_before_members_in_anonymous_types  = true 
143+ csharp_new_line_between_query_expression_clauses  = true 
144+ 
145+ #  Indentation preferences
146+ csharp_indent_block_contents  = true 
147+ csharp_indent_braces  = false 
148+ csharp_indent_case_contents  = true 
149+ csharp_indent_case_contents_when_block  = true 
150+ csharp_indent_switch_labels  = true 
151+ csharp_indent_labels  = flush_left 
152+ 
153+ #  Prefer "var" everywhere
154+ csharp_style_var_for_built_in_types  = true :suggestion 
155+ csharp_style_var_when_type_is_apparent  = true :suggestion 
156+ csharp_style_var_elsewhere  = true :suggestion 
157+ 
158+ #  Prefer method-like constructs to have a block body
159+ csharp_style_expression_bodied_methods  = false :none 
160+ csharp_style_expression_bodied_constructors  = false :none 
161+ csharp_style_expression_bodied_operators  = false :none 
162+ 
163+ #  Prefer property-like constructs to have an expression-body
164+ csharp_style_expression_bodied_properties  = true :none 
165+ csharp_style_expression_bodied_indexers  = true :none 
166+ csharp_style_expression_bodied_accessors  = true :none 
167+ 
168+ #  Suggest more modern language features when available
169+ csharp_style_pattern_matching_over_is_with_cast_check  = true :suggestion 
170+ csharp_style_pattern_matching_over_as_with_null_check  = true :suggestion 
171+ csharp_style_inlined_variable_declaration  = true :suggestion 
172+ csharp_style_throw_expression  = true :suggestion 
173+ csharp_style_conditional_delegate_call  = true :suggestion 
174+ 
175+ #  Space preferences
176+ csharp_space_after_cast  = false 
177+ csharp_space_after_colon_in_inheritance_clause  = true 
178+ csharp_space_after_comma  = true 
179+ csharp_space_after_dot  = false 
180+ csharp_space_after_keywords_in_control_flow_statements  = true 
181+ csharp_space_after_semicolon_in_for_statement  = true 
182+ csharp_space_around_binary_operators  = before_and_after 
183+ csharp_space_around_declaration_statements  = do_not_ignore 
184+ csharp_space_before_colon_in_inheritance_clause  = true 
185+ csharp_space_before_comma  = false 
186+ csharp_space_before_dot  = false 
187+ csharp_space_before_open_square_brackets  = false 
188+ csharp_space_before_semicolon_in_for_statement  = false 
189+ csharp_space_between_empty_square_brackets  = false 
190+ csharp_space_between_method_call_empty_parameter_list_parentheses  = false 
191+ csharp_space_between_method_call_name_and_opening_parenthesis  = false 
192+ csharp_space_between_method_call_parameter_list_parentheses  = false 
193+ csharp_space_between_method_declaration_empty_parameter_list_parentheses  = false 
194+ csharp_space_between_method_declaration_name_and_open_parenthesis  = false 
195+ csharp_space_between_method_declaration_parameter_list_parentheses  = false 
196+ csharp_space_between_parentheses  = false 
197+ csharp_space_between_square_brackets  = false 
198+ 
199+ #  Blocks are allowed
200+ csharp_prefer_braces  = true :silent 
201+ csharp_preserve_single_line_blocks  = true 
202+ csharp_preserve_single_line_statements  = true 
0 commit comments