# ##############################################################
# #
# #   .editorconfig – Hellion Forge / Hellion Media
# #
# #   Überarbeitet: Mai 2026
# #
# #   Strategie:
# #     - Standard-.NET-Conventions (private Fields = _camelCase)
# #     - CSharpier übernimmt die meiste Formatierung
# #     - Hier: Naming, IDE-Hints, Backup-Format-Regeln
# #
# # ##############################################################

root = true


# =====================================================
# Defaults (alle Files)
# =====================================================

[*]
indent_style = space
tab_width = 4
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true


# =====================================================
# Markdown: Trailing Spaces erlaubt (2 Spaces = <br>)
# =====================================================

[*.md]
trim_trailing_whitespace = false


# =====================================================
# JSON / YAML / Web-Configs: 2-Space-Indent
# Konsistent mit yamllint und Prettier-Override
# =====================================================

[*.{yaml,yml}]
indent_size = 2

[*.{json,jsonc,har,jsb2,jsb3,postman_collection,postman_environment}]
indent_size = 2

[{.babelrc,.eslintrc,.prettierrc,.markdownlintrc,.stylelintrc,bowerrc}]
indent_size = 2


# =====================================================
# .NET / XAML / Razor / Resources: 4-Space-Indent
# =====================================================

[*.{cs,csx,vb,fs,fsi,fsx}]
indent_size = 4

[*.{xml,xsd,xaml,axaml,paml,resx,resw,nuspec,config}]
indent_size = 4

[*.{cshtml,razor,aspx,ascx,asax,master,axaml}]
indent_size = 4


# ##############################################################
# #
# #   C# Sektion: Style, Naming, Format
# #
# ##############################################################

[*.{cs,csx}]


# =====================================================
# C# Style – var-Präferenz
# =====================================================

csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion


# =====================================================
# C# Style – Sonstiges
# =====================================================

# UTF-8 String Literals (C# 11+)
csharp_style_prefer_utf8_string_literals = true:suggestion

# Reihenfolge der Access-Modifier (Microsoft-Empfehlung)
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion

# Initializer: nicht alles auf eine Zeile
csharp_new_line_before_members_in_object_initializers = false


# =====================================================
# C# Format – Braces (Backup, falls CSharpier nicht läuft)
# =====================================================

# Allman Style: Klammern auf neue Zeile
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true


# =====================================================
# C# Format – Switch-Einrückung
# =====================================================

csharp_indent_case_contents = true
csharp_indent_switch_labels = true


# =====================================================
# .NET Style – Qualification (kein "this." nötig)
# =====================================================

dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion


# =====================================================
# .NET Style – Predefined Types (int statt Int32 etc.)
# =====================================================

dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion


# =====================================================
# .NET Style – Parentheses
# =====================================================

dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none


# =====================================================
# .NET Style – Accessibility-Modifier erzwingen
# =====================================================

dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion


# ##############################################################
# #
# #   Naming Conventions (.NET-Standard)
# #
# #   Private Instance Fields:      _camelCase
# #   Private Static Fields:        _camelCase
# #   Private Constants:            PascalCase
# #   Private Static Readonly:      PascalCase
# #
# ##############################################################

# === Style: Underscore + camelCase ===
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case_style.required_prefix = _

# === Style: PascalCase ===
dotnet_naming_style.pascal_case_style.capitalization = pascal_case


# === Rule: Private Instance Fields → _camelCase ===
dotnet_naming_rule.private_instance_fields.severity = warning
dotnet_naming_rule.private_instance_fields.symbols = private_instance_fields_symbols
dotnet_naming_rule.private_instance_fields.style = underscore_camel_case_style

dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private


# === Rule: Private Static Fields → _camelCase ===
dotnet_naming_rule.private_static_fields.severity = warning
dotnet_naming_rule.private_static_fields.symbols = private_static_fields_symbols
dotnet_naming_rule.private_static_fields.style = underscore_camel_case_style

dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static


# === Rule: Private Constants → PascalCase ===
dotnet_naming_rule.private_constants.severity = warning
dotnet_naming_rule.private_constants.symbols = private_constants_symbols
dotnet_naming_rule.private_constants.style = pascal_case_style

dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_constants_symbols.required_modifiers = const


# === Rule: Private Static Readonly → PascalCase ===
dotnet_naming_rule.private_static_readonly.severity = warning
dotnet_naming_rule.private_static_readonly.symbols = private_static_readonly_symbols
dotnet_naming_rule.private_static_readonly.style = pascal_case_style

dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly


# ##############################################################
# #
# #   JetBrains Rider / ReSharper Settings
# #
# ##############################################################

# === Brace-Style (für ReSharper-spezifische Formatierung) ===
resharper_csharp_brace_style = next_line

# Kurze Statements ohne Klammern erlaubt (für 1-Zeiler)
resharper_csharp_braces_for_foreach = not_required
resharper_csharp_braces_for_for = not_required
resharper_csharp_braces_for_while = not_required

# === Auto-Detection und Formatter-Tags ===
resharper_autodetect_indent_settings = true
resharper_use_indent_from_vs = false

# Erlaubt @formatter:off / @formatter:on Kommentare im Code
resharper_formatter_off_tag = @formatter:off
resharper_formatter_on_tag = @formatter:on
resharper_formatter_tags_enabled = true


# =====================================================
# ReSharper Inspection Severities
# (Hints = blaue Wellen, Warnings = gelb, Errors = rot)
# =====================================================

# Style-Suggestions: nur als Hint anzeigen
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_arrange_type_member_modifiers_highlighting = hint
resharper_arrange_type_modifiers_highlighting = hint
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
resharper_built_in_type_reference_style_highlighting = hint
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = hint
resharper_suggest_var_or_type_simple_types_highlighting = hint

# Echte Probleme: als Warning
resharper_redundant_base_qualifier_highlighting = warning