@@ -6,32 +6,36 @@ root = true
66# Don't use tabs for indentation.
77[* ]
88indent_style = space
9+
910# (Please don't specify an indent_size here; that has too many unintended consequences.)
1011
1112[* .yml ]
1213indent_size = 2
14+ indent_style = space
1315
1416# Code files
15- [* .{cs,csx,vb,vbx} ]
17+ [* .{cs,csx,vb,vbx,h,cpp,idl } ]
1618indent_size = 4
19+ insert_final_newline = true
20+ trim_trailing_whitespace = true
1721
1822# Xml project files
19- [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
23+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj } ]
2024indent_size = 2
2125
2226# Xml config files
23- [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
27+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,runsettings } ]
2428indent_size = 2
2529
2630# JSON files
2731[* .json ]
2832indent_size = 2
33+ indent_style = space
2934
3035# Dotnet code style settings:
3136[* .{cs,vb} ]
3237# Sort using and Import directives with System.* appearing first
3338dotnet_sort_system_directives_first = true
34- # Use "this." and "Me." everywhere
3539dotnet_style_qualification_for_field = true :warning
3640dotnet_style_qualification_for_property = true :warning
3741dotnet_style_qualification_for_method = true :warning
@@ -48,22 +52,96 @@ dotnet_style_coalesce_expression = true:suggestion
4852dotnet_style_null_propagation = true :suggestion
4953dotnet_style_explicit_tuple_names = true :suggestion
5054
55+ # Non-private static fields are PascalCase
56+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
57+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
58+ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
59+
60+ dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
61+ dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected
62+ dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
63+
64+ dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
65+
66+ # Constants are PascalCase
67+ dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
68+ dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
69+ dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
70+
71+ dotnet_naming_symbols.constants.applicable_kinds = field, local
72+ dotnet_naming_symbols.constants.required_modifiers = const
73+
74+ dotnet_naming_style.constant_style.capitalization = pascal_case
75+
76+ # Static fields are camelCase
77+ dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
78+ dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
79+ dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
80+
81+ dotnet_naming_symbols.static_fields.applicable_kinds = field
82+ dotnet_naming_symbols.static_fields.required_modifiers = static
83+
84+ dotnet_naming_style.static_field_style.capitalization = camel_case
85+
86+ # Instance fields are camelCase
87+ dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
88+ dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
89+ dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
90+
91+ dotnet_naming_symbols.instance_fields.applicable_kinds = field
92+
93+ dotnet_naming_style.instance_field_style.capitalization = camel_case
94+
95+ # Locals and parameters are camelCase
96+ dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
97+ dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
98+ dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
99+
100+ dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
101+
102+ dotnet_naming_style.camel_case_style.capitalization = camel_case
103+
104+ # Local functions are PascalCase
105+ dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
106+ dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
107+ dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
108+
109+ dotnet_naming_symbols.local_functions.applicable_kinds = local_function
110+
111+ dotnet_naming_style.local_function_style.capitalization = pascal_case
112+
113+ # By default, name items with PascalCase
114+ dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
115+ dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
116+ dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
117+
118+ dotnet_naming_symbols.all_members.applicable_kinds = *
119+
120+ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
121+
51122# CSharp code style settings:
52123[* .cs ]
124+ # Indentation preferences
125+ csharp_indent_block_contents = true
126+ csharp_indent_braces = false
127+ csharp_indent_case_contents = true
128+ csharp_indent_switch_labels = true
129+ csharp_indent_labels = flush_left
130+
53131# Prefer "var" everywhere
54- csharp_style_var_for_built_in_types = false : none
55- csharp_style_var_when_type_is_apparent = true :none
56- csharp_style_var_elsewhere = false :none
132+ csharp_style_var_for_built_in_types = false
133+ csharp_style_var_when_type_is_apparent = true :suggestion
134+ csharp_style_var_elsewhere = false :warning
57135
58136# Prefer method-like constructs to have a block body
59- csharp_style_expression_bodied_methods = true : suggestion
60- csharp_style_expression_bodied_constructors = true : suggestion
61- csharp_style_expression_bodied_operators = true : suggestion
137+ csharp_style_expression_bodied_methods = false : none
138+ csharp_style_expression_bodied_constructors = false : none
139+ csharp_style_expression_bodied_operators = false : none
62140
63141# Prefer property-like constructs to have an expression-body
64- csharp_style_expression_bodied_properties = true :suggestion
65- csharp_style_expression_bodied_indexers = true :suggestion
66- csharp_style_expression_bodied_accessors = true :suggestion
142+ csharp_style_expression_bodied_properties = true :none
143+ csharp_style_expression_bodied_indexers = true :none
144+ csharp_style_expression_bodied_accessors = true :none
67145
68146# Suggest more modern language features when available
69147csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
@@ -85,3 +163,24 @@ dotnet_diagnostic.CSIsNull001.severity = warning
85163
86164# CSIsNull002: Use `is object` for non-null checks
87165dotnet_diagnostic.CSIsNull002.severity = warning
166+
167+ # Blocks are allowed
168+ csharp_prefer_braces = true :silent
169+
170+ # SA1130: Use lambda syntax
171+ dotnet_diagnostic.SA1130.severity = silent
172+
173+ # IDE1006: Naming Styles - StyleCop handles these for us
174+ dotnet_diagnostic.IDE1006.severity = none
175+
176+ dotnet_diagnostic.DOC100.severity = silent
177+ dotnet_diagnostic.DOC104.severity = warning
178+ dotnet_diagnostic.DOC105.severity = warning
179+ dotnet_diagnostic.DOC106.severity = warning
180+ dotnet_diagnostic.DOC107.severity = warning
181+ dotnet_diagnostic.DOC108.severity = warning
182+ dotnet_diagnostic.DOC200.severity = warning
183+ dotnet_diagnostic.DOC202.severity = warning
184+
185+ [* .sln ]
186+ indent_style = tab
0 commit comments