-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.editorconfig
165 lines (137 loc) · 7.14 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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# EditorConfig is awesome: http://EditorConfig.org
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
# https://github.com/dotnet/roslyn/blob/master/.editorconfig
# top-most EditorConfig file
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)
# Code files
[*.cs]
indent_size = 4
# Xml project files
[*.csproj]
indent_size = 2
# Xml config files
[*.xml]
indent_size = 2
# JSON files
[*.json]
indent_size = 2
# Dotnet code style settings:
[*.cs]
# Prefer accessibility modifiers
dotnet_style_require_accessibility_modifiers = always:warning
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
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
# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
# Suggest more modern language features when available
dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_coalesce_expression = true:warning
dotnet_style_null_propagation = true:warning
dotnet_style_explicit_tuple_names = true:warning
# CSharp code style settings:
[*.cs]
# Prefer "var"
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:warning
# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_inlined_variable_declaration = true:warning
csharp_style_throw_expression = true:warning
csharp_style_conditional_delegate_call = true:warning
csharp_prefer_simple_default_expression = true:warning
# Newline settings
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
# Naming Conventions
[*.cs]
# pascal_case style
dotnet_naming_style.pascal_case__style.capitalization = pascal_case
# camel_case style
dotnet_naming_style.camel_case__style.capitalization = camel_case
# underscore_camel_case style
dotnet_naming_style.underscore_camel_case__style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case__style.required_prefix = _
# interfaces rule
dotnet_naming_rule.interfaces__rule.severity = warning
dotnet_naming_rule.interfaces__rule.style = interfaces__style
dotnet_naming_style.interfaces__style.capitalization = pascal_case
dotnet_naming_style.interfaces__style.required_prefix = I
dotnet_naming_rule.interfaces__rule.symbols = interfaces__symbols
dotnet_naming_symbols.interfaces__symbols.applicable_kinds = interface
# async methodes rule
dotnet_naming_rule.async_methodes__rule.severity = warning
dotnet_naming_rule.async_methodes__rule.style = async_methodes__style
dotnet_naming_style.async_methodes__style.capitalization = pascal_case
dotnet_naming_style.async_methodes__style.required_suffix = Async
dotnet_naming_rule.async_methodes__rule.symbols = async_methodes__symbols
dotnet_naming_symbols.async_methodes__symbols.applicable_kinds = method
dotnet_naming_symbols.async_methodes__symbols.required_modifiers = async
# methodes rule
dotnet_naming_rule.methodes__rule.severity = warning
dotnet_naming_rule.methodes__rule.style = pascal_case__style
dotnet_naming_rule.methodes__rule.symbols = methodes__symbols
dotnet_naming_symbols.methodes__symbols.applicable_kinds = method
# parameters rule
dotnet_naming_rule.parameters__rule.severity = warning
dotnet_naming_rule.parameters__rule.style = camel_case__style
dotnet_naming_rule.parameters__rule.symbols = parameters__symbols
dotnet_naming_symbols.parameters__symbols.applicable_kinds = parameter
# public properties rule
dotnet_naming_rule.public_properties__rule.severity = warning
dotnet_naming_rule.public_properties__rule.style = pascal_case__style
dotnet_naming_rule.public_properties__rule.symbols = public_properties__symbols
dotnet_naming_symbols.public_properties__symbols.applicable_kinds = property
dotnet_naming_symbols.public_properties__symbols.applicable_accessibilities = public
# private readonly fields rule
dotnet_naming_rule.private_readonly_fields__rule.severity = warning
dotnet_naming_rule.private_readonly_fields__rule.style = pascal_case__style
dotnet_naming_rule.private_readonly_fields__rule.symbols = private_readonly_fields__symbols
dotnet_naming_symbols.private_readonly_fields__symbols.applicable_kinds = field
dotnet_naming_symbols.private_readonly_fields__symbols.applicable_accessibilities = internal, private, protected
dotnet_naming_symbols.private_readonly_fields__symbols.required_modifiers = readonly
# private const fields rule
dotnet_naming_rule.private_const_fields__rule.severity = warning
dotnet_naming_rule.private_const_fields__rule.style = pascal_case__style
dotnet_naming_rule.private_const_fields__rule.symbols = private_const_fields__symbols
dotnet_naming_symbols.private_const_fields__symbols.applicable_kinds = field
dotnet_naming_symbols.private_const_fields__symbols.applicable_accessibilities = internal, private, protected, public # 'public' as fix for enum issue https://github.com/dotnet/roslyn/issues/24209
dotnet_naming_symbols.private_const_fields__symbols.required_modifiers = const
# private fields rule
dotnet_naming_rule.private_fields__rule.severity = warning
dotnet_naming_rule.private_fields__rule.style = underscore_camel_case__style
dotnet_naming_rule.private_fields__rule.symbols = private_fields__symbols
dotnet_naming_symbols.private_fields__symbols.applicable_kinds = field
dotnet_naming_symbols.private_fields__symbols.applicable_accessibilities = internal, private, protected
# not use public fields rule
dotnet_naming_rule.not_use_public_fields__rule.severity = warning
dotnet_naming_rule.not_use_public_fields__rule.style = not_use_public_fields__style
dotnet_naming_style.not_use_public_fields__style.capitalization = pascal_case
dotnet_naming_style.not_use_public_fields__style.required_prefix = NOT_use_public_fields__use_properties_instead__
dotnet_naming_rule.not_use_public_fields__rule.symbols = not_use_public_fields__symbols
dotnet_naming_symbols.not_use_public_fields__symbols.applicable_kinds = field
dotnet_naming_symbols.not_use_public_fields__symbols.applicable_accessibilities = public