1- #  Remove the line below if you want to inherit .editorconfig settings from higher directories
1+ #  EditorConfig is awesome: https://EditorConfig.org
2+ #  Taken from https://github.com/dotnet/roslyn/blob/main/.editorconfig
3+ #  Modified slightly to better suit RiptideNetworking
4+ 
5+ #  top-most EditorConfig file
26root  = true 
37
4- #  C# files
5- [* .cs
8+ #  Don't use tabs for indentation.
9+ [* 
10+ indent_style  = space 
11+ #  (Please don't specify an indent_size here; that has too many unintended consequences.)
612
7- dotnet_style_prefer_conditional_expression_over_return  = false :warning 
13+ #  Code files
14+ [* .{cs,csx,vb,vbx}
15+ indent_size  = 4 
16+ insert_final_newline  = true 
17+ charset  = utf-8-bom 
818
9- # ### Core EditorConfig Options #### 
10- csharp_style_unused_value_assignment_preference  =  false : none 
11- csharp_style_unused_value_expression_statement_preference  = false : none 
19+ #  XML project files 
20+ [ * .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ] 
21+ indent_size  = 2 
1222
13- dotnet_diagnostic.IDE0090.severity  =  none 
14- csharp_style_namespace_declarations  =  file_scoped 
15- dotnet_analyzer_diagnostic.severity  = suggestion 
23+ #  XML config files 
24+ [ * .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ] 
25+ indent_size  = 2 
1626
17- #  Prefer "var" everywhere
18- csharp_style_var_for_built_in_types  = false :warning 
19- csharp_style_var_when_type_is_apparent  = false :warning 
20- csharp_style_var_elsewhere  = false :warning 
27+ #  JSON files
28+ [* .json
29+ indent_size  = 2 
30+ 
31+ #  Powershell files
32+ [* .ps1
33+ indent_size  = 2 
34+ 
35+ #  Shell script files
36+ [* .sh
37+ end_of_line  = lf 
38+ indent_size  = 2 
39+ 
40+ #  Dotnet code style settings:
41+ [* .{cs,vb}
2142
2243#  IDE0055: Fix formatting
2344dotnet_diagnostic.IDE0055.severity  = warning 
2445
46+ #  Prefer not to use new();
47+ dotnet_diagnostic.IDE0090.severity  = none 
48+ 
2549#  Sort using and Import directives with System.* appearing first
2650dotnet_sort_system_directives_first  = true 
2751dotnet_separate_import_directive_groups  = false 
@@ -124,11 +148,11 @@ dotnet_naming_symbols.all_members.applicable_kinds = *
124148dotnet_naming_style.pascal_case_style.capitalization  = pascal_case 
125149
126150#  error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'
127- dotnet_diagnostic.RS2008.severity  = suggestion 
151+ dotnet_diagnostic.RS2008.severity  = none 
128152
129153#  IDE0073: File header
130154#  dotnet_diagnostic.IDE0073.severity = warning
131- #  file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information. 
155+ #  file_header_template =
132156
133157#  IDE0035: Remove unreachable code
134158dotnet_diagnostic.IDE0035.severity  = warning 
@@ -145,6 +169,8 @@ dotnet_diagnostic.IDE0044.severity = warning
145169#  RS0016: Only enable if API files are present
146170dotnet_public_api_analyzer.require_api_files  = true 
147171
172+ #  CSharp code style settings:
173+ [* .cs
148174#  Newline settings
149175csharp_new_line_before_open_brace  = all 
150176csharp_new_line_before_else  = true 
@@ -167,15 +193,20 @@ csharp_style_allow_embedded_statements_on_same_line_experimental = false
167193csharp_style_allow_blank_lines_between_consecutive_braces_experimental  = false 
168194csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental  = false 
169195
196+ #  Prefer "var" everywhere
197+ csharp_style_var_for_built_in_types  = false :suggestion 
198+ csharp_style_var_when_type_is_apparent  = false :suggestion 
199+ csharp_style_var_elsewhere  = false :suggestion 
200+ 
170201#  Prefer method-like constructs to have a block body
171- csharp_style_expression_bodied_methods  = false :suggestion 
172- csharp_style_expression_bodied_constructors  = false :suggestion 
173- csharp_style_expression_bodied_operators  = false :suggestion 
202+ csharp_style_expression_bodied_methods  = false :none 
203+ csharp_style_expression_bodied_constructors  = false :none 
204+ csharp_style_expression_bodied_operators  = false :none 
174205
175206#  Prefer property-like constructs to have an expression-body
176- csharp_style_expression_bodied_properties  = true :suggestion 
177- csharp_style_expression_bodied_indexers  = true :suggestion 
178- csharp_style_expression_bodied_accessors  = true :suggestion 
207+ csharp_style_expression_bodied_properties  = true :none 
208+ csharp_style_expression_bodied_indexers  = true :none 
209+ csharp_style_expression_bodied_accessors  = true :none 
179210
180211#  Suggest more modern language features when available
181212csharp_style_pattern_matching_over_is_with_cast_check  = true :suggestion 
@@ -217,8 +248,11 @@ csharp_preserve_single_line_statements = true
217248#  https://github.com/dotnet/roslyn/pull/54259 has been published.
218249dotnet_style_allow_statement_immediately_after_block_experimental  = false 
219250
251+ [src/CodeStyle/** .{cs,vb} ]
220252#  warning RS0005: Do not use generic CodeAction.Create to create CodeAction
221- dotnet_diagnostic.RS0005.severity  = suggestion 
253+ dotnet_diagnostic.RS0005.severity  = none 
254+ 
255+ [src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures,VisualStudio}/** /* .{cs,vb} ]
222256
223257#  IDE0011: Add braces
224258csharp_prefer_braces  = when_multiline:warning 
@@ -230,7 +264,7 @@ dotnet_diagnostic.IDE0040.severity = warning
230264
231265#  CONSIDER: Are IDE0051 and IDE0052 too noisy to be warnings for IDE editing scenarios? Should they be made build-only warnings?
232266#  IDE0051: Remove unused private member
233- dotnet_diagnostic.IDE0051.severity  = none 
267+ dotnet_diagnostic.IDE0051.severity  = warning 
234268
235269#  IDE0052: Remove unread private member
236270dotnet_diagnostic.IDE0052.severity  = warning 
@@ -239,14 +273,20 @@ dotnet_diagnostic.IDE0052.severity = warning
239273dotnet_diagnostic.IDE0059.severity  = warning 
240274
241275#  IDE0060: Remove unused parameter
242- dotnet_diagnostic.IDE0060.severity  = suggestion 
276+ dotnet_diagnostic.IDE0060.severity  = warning 
243277
244278#  CA1012: Abstract types should not have public constructors
245279dotnet_diagnostic.CA1012.severity  = warning 
246280
247281#  CA1822: Make member static
248282dotnet_diagnostic.CA1822.severity  = warning 
249283
284+ #  Prefer "var" everywhere
285+ dotnet_diagnostic.IDE0007.severity  = warning 
286+ csharp_style_var_for_built_in_types  = true :warning 
287+ csharp_style_var_when_type_is_apparent  = true :warning 
288+ csharp_style_var_elsewhere  = true :warning 
289+ 
250290#  dotnet_style_allow_multiple_blank_lines_experimental
251291dotnet_diagnostic.IDE2000.severity  = warning 
252292
@@ -262,6 +302,7 @@ dotnet_diagnostic.IDE2003.severity = warning
262302#  csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental
263303dotnet_diagnostic.IDE2004.severity  = warning 
264304
305+ [src/{VisualStudio}/** /* .{cs,vb} ]
265306#  CA1822: Make member static
266307#  Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858
267308#  Additionally, there is a risk of accidentally breaking an internal API that partners rely on though IVT.
0 commit comments