-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.editorconfig
More file actions
112 lines (93 loc) · 4.44 KB
/
Copy path.editorconfig
File metadata and controls
112 lines (93 loc) · 4.44 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
root = true
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.{cs,csx,csproj,props,targets,slnx,json,config}]
indent_style = tab
indent_size = 4
tab_width = 4
[*.{cs,csx}]
# Formatting
dotnet_diagnostic.IDE0055.severity = error
# XML documentation on all public members
dotnet_diagnostic.CS1591.severity = error
# Analyzer strictness
dotnet_analyzer_diagnostic.category-Style.severity = error
dotnet_analyzer_diagnostic.category-Performance.severity = warning
dotnet_analyzer_diagnostic.category-Reliability.severity = warning
dotnet_analyzer_diagnostic.category-Maintainability.severity = warning
# Globalization and string comparison discipline
dotnet_diagnostic.CA1309.severity = error
# Nullability discipline
dotnet_diagnostic.CS8600.severity = error
dotnet_diagnostic.CS8602.severity = error
dotnet_diagnostic.CS8603.severity = error
dotnet_diagnostic.CS8604.severity = error
dotnet_diagnostic.CS8618.severity = error
# Modern C# style
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
csharp_style_namespace_declarations = file_scoped:error
csharp_prefer_simple_using_statement = true:error
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_throw_expression = true:error
csharp_prefer_braces = true:error
# Prefer var wherever possible
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error
# Expression and pattern preferences
csharp_style_prefer_switch_expression = true:error
csharp_style_prefer_pattern_matching = true:error
csharp_style_prefer_not_pattern = true:error
csharp_style_prefer_readonly_struct = true:warning
csharp_style_prefer_readonly_struct_member = true:warning
csharp_style_prefer_method_group_conversion = true:suggestion
csharp_style_prefer_top_level_statements = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
# Naming conventions
dotnet_naming_rule.private_fields_should_be_camel_case.severity = error
dotnet_naming_rule.private_fields_should_be_camel_case.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camel_case.style = camel_case_underscore
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_style.camel_case_underscore.required_prefix = _
dotnet_naming_style.camel_case_underscore.capitalization = camel_case
# CAxxxx analyzers
dotnet_diagnostic.CA1066.severity = warning
dotnet_diagnostic.CA1068.severity = warning
dotnet_diagnostic.CA1819.severity = suggestion # byte[] in record DTOs is acceptable; ImmutableArray<byte> would be too invasive
dotnet_diagnostic.CA1823.severity = warning
dotnet_diagnostic.CA2207.severity = warning
# IDExxxx analyzers
dotnet_diagnostic.IDE1006.severity = warning
# Meziantou Analyzers
dotnet_diagnostic.MA0032.severity = suggestion # CancellationToken is good practice but shouldn't block compilation
dotnet_diagnostic.MA0045.severity = warning # Do not use blocking calls in a sync method (need to make calling method async)
dotnet_diagnostic.MA0080.severity = error # Use a cancellation token using .WithCancellation()
dotnet_diagnostic.MA0155.severity = error # No async void
dotnet_diagnostic.MA0162.severity = error # Correctly use Process.Start()
dotnet_diagnostic.MA0167.severity = warning # Force usage of TimeProvider whenever possible
dotnet_diagnostic.MA0168.severity = error # Correctly use readonly structs
dotnet_diagnostic.MA0171.severity = warning # Don't use the ugly .HasValue on nullable types
dotnet_diagnostic.MA0180.severity = warning # Correctly use ILogging types
dotnet_diagnostic.MA0181.severity = none # Explicit casts are idiomatic in low-level serialization/rendering code
dotnet_diagnostic.MA0186.severity = warning # Correctly use [NotNullWhen()]
# Relax certain analyzers in test projects and samples — intentional sync patterns are common.
[{src/Repl.IntegrationTests/**.cs,src/Repl.McpTests/**.cs,src/Repl.Tests/**.cs,src/Repl.ShellCompletionTestHost/**.cs,samples/**/**.cs}]
dotnet_diagnostic.MA0045.severity = suggestion
dotnet_diagnostic.MA0167.severity = suggestion