Skip to content

Commit

Permalink
Align editorconfig with framework
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed May 3, 2022
1 parent 5513710 commit 547038f
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
# EditorConfig is awesome: http://editorconfig.org
root = true

[*.{csproj,props,targets}]
charset = utf-8-bom
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.cs]
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

#license header
file_header_template = Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.\nSee the LICENCE file in the repository root for full licence text.

#Roslyn naming styles

#PascalCase for public and protected members
dotnet_naming_style.pascalcase.capitalization = pascal_case
dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event
dotnet_naming_rule.public_members_pascalcase.severity = error
dotnet_naming_rule.public_members_pascalcase.symbols = public_members
dotnet_naming_rule.public_members_pascalcase.style = pascalcase

#camelCase for private members
dotnet_naming_style.camelcase.capitalization = camel_case

Expand Down Expand Up @@ -157,7 +176,7 @@ csharp_style_unused_value_assignment_preference = discard_variable:warning

#Style - variable declaration
csharp_style_inlined_variable_declaration = true:warning
csharp_style_deconstructed_variable_declaration = false:silent
csharp_style_deconstructed_variable_declaration = true:warning

#Style - other C# 7.x features
dotnet_style_prefer_inferred_tuple_names = true:warning
Expand All @@ -168,28 +187,15 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
#Style - C# 8 features
csharp_prefer_static_local_function = true:warning
csharp_prefer_simple_using_statement = true:silent
csharp_style_prefer_index_operator = false:silent
csharp_style_prefer_range_operator = false:silent
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_range_operator = true:warning
csharp_style_prefer_switch_expression = false:none

#Supressing roslyn built-in analyzers
# Suppress: EC112

#Private method is unused
dotnet_diagnostic.IDE0051.severity = silent
#Private member is unused
dotnet_diagnostic.IDE0052.severity = silent

#Rules for disposable
dotnet_diagnostic.IDE0067.severity = none
dotnet_diagnostic.IDE0068.severity = none
dotnet_diagnostic.IDE0069.severity = none

#Disable operator overloads requiring alternate named methods
dotnet_diagnostic.CA2225.severity = none

# Banned APIs
dotnet_diagnostic.RS0030.severity = error
[*.{yaml,yml}]
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

dotnet_diagnostic.OLOC001.words_in_name = 5
dotnet_diagnostic.OLOC001.license_header = // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.\n// See the LICENCE file in the repository root for full licence text.

0 comments on commit 547038f

Please sign in to comment.