Skip to content

Commit

Permalink
chore: fix static fields formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Feb 5, 2024
1 parent 4113deb commit cb65bee
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,49 @@ charset = utf-8
csharp_new_line_before_open_brace = none
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_prefer_braces = false:error
csharp_prefer_braces = false:warning

# Always use "this" keyword
dotnet_style_qualification_for_field = true:error
dotnet_style_qualification_for_property = true:error
dotnet_style_qualification_for_method = true:error
dotnet_style_qualification_for_event = true:error
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning

# Suggest acessibility modifier is redundant
dotnet_style_require_accessibility_modifiers = never:error
dotnet_style_require_accessibility_modifiers = never:warning

# Never use "var"
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning
csharp_style_var_elsewhere = false:warning

# Only file-scoped namespaces are allowed
csharp_style_namespace_declarations = file_scoped:warning

# Prefer expression bodies for single line statements
csharp_style_expression_bodied_constructors = when_on_single_line:warning
csharp_style_expression_bodied_methods = when_on_single_line:warning
csharp_style_expression_bodied_operators = when_on_single_line:warning
csharp_style_expression_bodied_properties = when_on_single_line:warning
csharp_style_expression_bodied_indexers = when_on_single_line:warning
csharp_style_expression_bodied_accessors = when_on_single_line:warning

# Symbols
dotnet_naming_symbols.special_fields.applicable_kinds = field
dotnet_naming_symbols.classes.applicable_accessibilities = *
dotnet_naming_symbols.special_fields.required_modifiers = static,readonly,const
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.applicable_accessibilities = *
dotnet_naming_symbols.static_fields.required_modifiers = static

dotnet_naming_symbols.fields.applicable_kinds = field,parameter,event,delegate
dotnet_naming_symbols.fields.applicable_kinds = field, parameter
dotnet_naming_symbols.fields.applicable_accessibilities = *

dotnet_naming_symbols.methods.applicable_kinds = method,property
dotnet_naming_symbols.methods.applicable_kinds = method, property, event, delegate
dotnet_naming_symbols.methods.applicable_accessibilities = *

dotnet_naming_symbols.classes.applicable_kinds = class,struct,interface,enum
dotnet_naming_symbols.classes.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.classes.applicable_accessibilities = *

# Styles
Expand All @@ -61,9 +72,9 @@ dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.first_word_upper.capitalization = first_word_upper

# Rules
dotnet_naming_rule.special_fields_pascal_case.symbols = special_fields
dotnet_naming_rule.special_fields_pascal_case.severity = error
dotnet_naming_rule.special_fields_pascal_case.style = pascal_case
dotnet_naming_rule.static_fields_pascal_case.symbols = static_fields
dotnet_naming_rule.static_fields_pascal_case.severity = error
dotnet_naming_rule.static_fields_pascal_case.style = pascal_case

dotnet_naming_rule.fields_camel_case.symbols = fields
dotnet_naming_rule.fields_camel_case.severity = error
Expand All @@ -82,13 +93,8 @@ dotnet_analyzer_diagnostic.category-Style.severity = warning
dotnet_analyzer_diagnostic.category-Performance.severity = warning
dotnet_analyzer_diagnostic.category-Design.severity = warning

dotnet_diagnostic.IDE0002.severity = none
dotnet_diagnostic.IDE0044.severity = none
dotnet_diagnostic.IDE0072.severity = none
dotnet_diagnostic.IDE0051.severity = none
dotnet_diagnostic.IDE0021.severity = none
dotnet_diagnostic.IDE0022.severity = none
dotnet_diagnostic.IDE0160.severity = none
dotnet_diagnostic.IDE0130.severity = none
dotnet_diagnostic.IDE0002.severity = none # Simplify member access
dotnet_diagnostic.IDE0051.severity = none # Remove unused private member
dotnet_diagnostic.IDE0072.severity = none # Add missing cases to switch expression
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure
dotnet_diagnostic.CS8524.severity = none
dotnet_diagnostic.CA1001.severity = error

0 comments on commit cb65bee

Please sign in to comment.