root = true

# All files
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
indent_style = space

# C# files
[*.cs]
# Nullable reference types

# Naming conventions
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion
dotnet_naming_rule.async_methods_end_in_async.symbols = async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async

dotnet_naming_symbols.async_methods.applicable_kinds = method
dotnet_naming_symbols.async_methods.required_modifiers = async

dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case

dotnet_naming_symbols.locals.applicable_kinds = local, parameter

dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.required_modifiers = const

dotnet_naming_style.camel_case.capitalization = camel_case

dotnet_naming_style.all_caps.capitalization = all_upper

dotnet_naming_rule.locals_must_be_camel.severity = warning
dotnet_naming_rule.locals_must_be_camel.symbols = locals
dotnet_naming_rule.locals_must_be_camel.style = camel_case

dotnet_naming_rule.consts_must_be_all_caps.severity = warning
dotnet_naming_rule.consts_must_be_all_caps.symbols = const_fields
dotnet_naming_rule.consts_must_be_all_caps.style = all_caps


# Turn off the naming style that enforces an underscore prefix for private fields
dotnet_naming_style.underscore_prefix_style.capitalization = camel_case
dotnet_naming_style.underscore_prefix_style.required_prefix = _

# Remove the rule that ties the naming style to private fields
dotnet_naming_rule.private_fields_underscore_rule.severity = none
dotnet_naming_rule.private_fields_underscore_rule.symbols = private_fields
dotnet_naming_rule.private_fields_underscore_rule.style = underscore_prefix_style

# Symbol group for private fields (so the rule can be disabled)
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

# Formatting
csharp_new_line_before_open_brace = all
csharp_indent_case_contents = true
csharp_space_after_cast = false

# Project files
[*.{csproj,props,targets}]
indent_size = 4

# JSON files
[*.json]
indent_size = 2

# Godot files
[*.{tscn,tres,godot}]
indent_size = 2
