-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.editorconfig
85 lines (68 loc) · 2.99 KB
/
.editorconfig
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
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
file_header_template = Copyright (c) David Pine. All rights reserved.\nLicensed under the MIT License.
# Code files
[*.cs]
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
end_of_line = lf
###############################
# .NET Coding Conventions #
###############################
[*.cs]
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
# this. preferences
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
# New line preferences
csharp_new_line_before_open_brace = all
# Namespace preference
csharp_style_namespace_declarations = file_scoped
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_keywords_in_control_flow_statements = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
# Expression-level preferences
dotnet_style_prefer_auto_properties = true:error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
# CSharp code style settings:
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error
# Patern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error
## Naming Conventions
# Async methods should have [Async] suffix
[*.cs]
dotnet_naming_rule.async_method_must_end_with_async.symbols = async_methods
dotnet_naming_symbols.async_methods.applicable_kinds = method
dotnet_naming_symbols.async_methods.applicable_accessibilities = *
dotnet_naming_symbols.async_methods.required_modifiers= async
dotnet_naming_rule.async_method_must_end_with_async.style = async_suffix
dotnet_naming_style.async_suffix.required_suffix = Async
dotnet_naming_rule.async_method_must_end_with_async.severity = error
# const fields use pascal casing
dotnet_naming_rule.const_fields_use_pascal_casing.symbols = const_fields
dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.applicable_accessibilities = *
dotnet_naming_symbols.const_fields.required_modifiers = const
dotnet_naming_rule.const_fields_use_pascal_casing.severity = error