-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.editorconfig
More file actions
117 lines (94 loc) · 5.34 KB
/
Copy path.editorconfig
File metadata and controls
117 lines (94 loc) · 5.34 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
root = true
[*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = false
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false
# ReSharper properties
resharper_csharp_indent_style = tab
resharper_csharp_max_line_length = 300
[*.cs]
indent_style = tab
indent_size = tab
tab_width = 4
# === Code style (informational; build-block on a few high-value rules below) ===
# Use 'this.' only when required
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
# Use language keywords for types (int over Int32)
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# var preferences — keep explicit (RevCore convention)
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
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_properties = true:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null checks
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# === Naming convention: private instance fields => m_camelCase ===
dotnet_naming_rule.private_instance_fields_with_m_prefix.severity = suggestion
dotnet_naming_rule.private_instance_fields_with_m_prefix.symbols = private_instance_fields
dotnet_naming_rule.private_instance_fields_with_m_prefix.style = m_prefix_style
dotnet_naming_symbols.private_instance_fields.applicable_kinds = field
dotnet_naming_symbols.private_instance_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_instance_fields.required_modifiers =
dotnet_naming_style.m_prefix_style.required_prefix = m_
dotnet_naming_style.m_prefix_style.capitalization = camel_case
# Private static fields => s_camelCase
dotnet_naming_rule.private_static_fields_with_s_prefix.severity = suggestion
dotnet_naming_rule.private_static_fields_with_s_prefix.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_with_s_prefix.style = s_prefix_style
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static
dotnet_naming_style.s_prefix_style.required_prefix = s_
dotnet_naming_style.s_prefix_style.capitalization = camel_case
# === Analyzer severities (build-blocking subset) ===
# Documentation
dotnet_diagnostic.CS1591.severity = warning # Missing XML doc on public member (escalated to error in CI via /warnaserror)
# Public API analyzer (enforces PublicAPI.Shipped/Unshipped)
# Disabled globally here, re-enabled with severity=error in Assets/RevCore/.editorconfig.
# Reason: the analyzer DLL has the RoslynAnalyzer asset label, so Unity feeds it to
# every csc invocation in the project — including legacy RCore folders that
# deliberately track no PublicAPI surface. Nested editorconfig wins per spec.
dotnet_diagnostic.RS0016.severity = none # Symbol not part of declared API
dotnet_diagnostic.RS0017.severity = none # Symbol is part of declared API but not found
dotnet_diagnostic.RS0022.severity = none # Public namespace not in shipped/unshipped
dotnet_diagnostic.RS0024.severity = none # PublicAPI file has invalid entry
dotnet_diagnostic.RS0025.severity = none # Duplicate entry in PublicAPI file
dotnet_diagnostic.RS0026.severity = none # Multiple public overloads + optional params — N/A for source packages
dotnet_diagnostic.RS0027.severity = none # Adding optional param to method with existing overload — N/A for source packages
dotnet_diagnostic.RS0041.severity = none # Public members should not use oblivious types — RevCore has not adopted #nullable enable project-wide
dotnet_diagnostic.RS0050.severity = none # Public API contains oblivious reference types — same reason as RS0041
dotnet_diagnostic.RS0051.severity = none # Public API has nullability mismatch — same reason as RS0041
# Performance / correctness
dotnet_diagnostic.CA1822.severity = suggestion # Member can be static
dotnet_diagnostic.CA2007.severity = none # ConfigureAwait — N/A in Unity
dotnet_diagnostic.CA1063.severity = warning # Implement IDisposable correctly
dotnet_diagnostic.CA1816.severity = warning # GC.SuppressFinalize call
dotnet_diagnostic.CA2208.severity = warning # ArgumentException — pass param name
# Obsolete usage must be visible
dotnet_diagnostic.CS0612.severity = warning # Obsolete (no message)
dotnet_diagnostic.CS0618.severity = warning # Obsolete (with message)
# PublicAPI analyzer rules are re-enabled with severity=error via
# Assets/RevCore/.editorconfig — nested config closest to the file wins.