Repository navigation
Expand file tree
/
Copy path.editorconfig
More file actions
151 lines (124 loc) · 6.4 KB
/
Copy path.editorconfig
File metadata and controls
151 lines (124 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# PowerCSharp.CleanArchitecture EditorConfig
# Merged from PowerCSharp + CleanArchitecture conventions
# Based on Microsoft .NET Design Guidelines with Google C# Style Guide enhancements
# Custom: No space after if/for/while statements
root = true
# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Configuration files (JSON, YAML, etc.)
[*.{json,yml,yaml,csproj,props,targets,config}]
indent_style = space
indent_size = 2
# Markdown files
[*.md]
trim_trailing_whitespace = false
# C# files
[*.cs]
# Core .NET formatting
indent_style = space
indent_size = 4
# Namespaces (CleanArchitecture preference)
csharp_style_namespace_declarations = file_scoped:warning
# this. preferences (CleanArchitecture preferences)
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
# var preferences (CleanArchitecture preferences)
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion
# Expression-bodied members (merged preferences)
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_prefer_expression_bodied_properties = true:silent
csharp_prefer_expression_bodied_methods = false:silent
csharp_prefer_expression_bodied_constructors = false:silent
csharp_prefer_expression_bodied_operators = false:silent
# Modifiers (CleanArchitecture preference + PowerCSharp enhancements)
dotnet_style_require_accessibility_modifiers = always:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,readonly,sealed,override,abstract,async:suggestion
# Custom PowerCSharp rules
# NO space after if/for/while (user requirement)
dotnet_style_space_after_keywords_in_control_flow_statements = false
# Space after commas (keep Google standard)
dotnet_style_space_after_comma = true
# No space after opening parenthesis or before closing (Google standard)
dotnet_style_space_within_parentheses = false
dotnet_style_space_between_parentheses = false
# One space between operators (Google standard)
dotnet_style_space_around_binary_operators = before_and_after
# Braces (Google standard - always use braces)
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
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
# Language rules
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Usings (merged preferences)
dotnet_sort_system_directives_first = true
csharp_using_directive_placement = outside_namespace:warning
# Naming conventions (PowerCSharp enhancements)
dotnet_naming_rule.interface_should_be_prefixed_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_prefixed_with_i.symbols = interfaces
dotnet_naming_rule.interface_should_be_prefixed_with_i.style = prefixed_with_i
dotnet_naming_symbols.interfaces.applicable_kinds = interface
dotnet_naming_style.prefixed_with_i.required_prefix = I
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.members.applicable_kinds = method, property, event, field
dotnet_naming_symbols.members.applicable_accessibilities = public, internal, protected, protected_internal, private
dotnet_naming_symbols.members.required_modifiers = readonly
# Private fields should be _camelCase
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.severity = suggestion
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.style = camel_case_with_underscore
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_style.camel_case_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_with_underscore.capitalization = camel_case
# Local variables and parameters should be camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case
dotnet_naming_symbols.locals.applicable_kinds = parameter, local
dotnet_naming_style.camel_case.capitalization = camel_case
# Constants should be PascalCase (following Google's approach over traditional UPPER_CASE)
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_style.pascal_case.capitalization = pascal_case
# Member ordering (Google standard - enforced manually during refactoring)
# 1. Nested classes, enums, delegates, events
# 2. Static/const/readonly fields
# 3. Fields and properties
# 4. Constructors and finalizers
# 5. Methods
# Within each group: Public → Internal → Protected internal → Protected → Private
# Null-checking
csharp_style_throw_expression = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# Naming: interfaces start with I
dotnet_naming_rule.interfaces_start_with_i.severity = warning
dotnet_naming_rule.interfaces_start_with_i.symbols = interface_symbol
dotnet_naming_rule.interfaces_start_with_i.style = i_prefix_style
dotnet_naming_symbols.interface_symbol.applicable_kinds = interface
dotnet_naming_style.i_prefix_style.required_prefix = I
dotnet_naming_style.i_prefix_style.capitalization = pascal_case