-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.editorconfig
More file actions
74 lines (59 loc) · 2.64 KB
/
Copy path.editorconfig
File metadata and controls
74 lines (59 loc) · 2.64 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
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yml,yaml,json}]
indent_size = 2
[*.{csproj,props,targets}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[*.cs]
# Sort using directives
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# Language rules
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
# Expression-bodied members
csharp_style_expression_bodied_methods = when_on_single_line:silent
csharp_style_expression_bodied_constructors = when_on_single_line:silent
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
# Pattern matching
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
# Modern features
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
# Naming
dotnet_naming_rule.interface_rule.severity = warning
dotnet_naming_rule.interface_rule.symbols = interface
dotnet_naming_rule.interface_rule.style = interface_style
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_style.interface_style.required_prefix = I
dotnet_naming_style.interface_style.capitalization = pascal_case
dotnet_naming_rule.private_field_rule.severity = warning
dotnet_naming_rule.private_field_rule.symbols = private_field
dotnet_naming_rule.private_field_rule.style = underscore_camel
dotnet_naming_symbols.private_field.applicable_kinds = field
dotnet_naming_symbols.private_field.applicable_accessibilities = private
dotnet_naming_style.underscore_camel.required_prefix = _
dotnet_naming_style.underscore_camel.capitalization = camel_case
# Code quality analyzers
dotnet_diagnostic.CA1014.severity = none # CLSCompliant attribute (not needed)
dotnet_diagnostic.CA2007.severity = none # ConfigureAwait (library code, handled case by case)
[tests/**/*.cs]
# CA1515: test classes must be public for xUnit discovery - suppress the
# "can be internal" suggestion so dotnet format doesn't flip visibility.
# CA1812: test classes look uninstantiated to analyzers but xUnit instantiates them.
dotnet_diagnostic.CA1515.severity = none
dotnet_diagnostic.CA1812.severity = none