-
Notifications
You must be signed in to change notification settings - Fork 10
/
.editorconfig
167 lines (134 loc) · 7.3 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
166
167
# EditorConfig helps create consistency for formatting of all
# the code in Dolittle
#
# http://EditorConfig.org
root = true
[*]
end_of_line = lf
indent_style = space
indent_size = 4
charset = utf-8
insert_final_newline = true
[*.yml]
indent_size = 2
[*.{cs,vb}]
# we're putting the :severity options on everything where it can be put as it's bugged on net5
# check https://github.com/dotnet/roslyn/issues/50785#issuecomment-768606882
# default to all on warning
# dotnet_analyzer_diagnostic.severity = warning
file_header_template = Copyright (c) Dolittle. All rights reserved.\nLicensed under the MIT license. See LICENSE file in the project root for full license information.
#### .NET Conventions ####
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
# dont prefer ifs over ternary operators
dotnet_style_prefer_conditional_expression_over_return = true:none
dotnet_style_prefer_conditional_expression_over_assignment = true:none
# dont need to declare private
dotnet_style_require_accessibility_modifiers = never:error
# consts are pascal case
dotnet_naming_rule.const_fields.symbols = const_fields
dotnet_naming_rule.const_fields.style = const_fields
dotnet_naming_rule.const_fields.severity = suggestion
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_style.const_fields.capitalization = pascal_case
dotnet_naming_style.const_fields.required_prefix =
# public static fields are pascal case
dotnet_naming_rule.static_readonly_fields.symbols = static_readonly_fields
dotnet_naming_rule.static_readonly_fields.style = static_readonly_fields
dotnet_naming_rule.static_readonly_fields.severity = suggestion
dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = public
dotnet_naming_symbols.static_readonly_fields.required_modifiers = static
dotnet_naming_style.static_readonly_fields.capitalization = pascal_case
dotnet_naming_style.static_readonly_fields.required_prefix =
# private fields should be camel case and start with _
dotnet_naming_rule.private_Fields.symbols = private_fields
dotnet_naming_rule.private_Fields.style = private_fields
dotnet_naming_rule.private_Fields.severity = suggestion
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.required_modifiers =
dotnet_naming_style.private_fields.capitalization = camel_case
dotnet_naming_style.private_fields.required_prefix = _
# upper camelcase for public properties
dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
dotnet_naming_rule.public_members_must_be_capitalized.severity = error
dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public
dotnet_naming_symbols.public_symbols.required_modifiers = readonly
## Specific rule suppression
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = none
# CA2016: Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2016.severity = none
# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = none
# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = none
# CA1710: Identifiers should have correct suffix
dotnet_diagnostic.CA1710.severity = none
#CA1711: Identifiers should not have incorrect suffix
dotnet_diagnostic.CA1711.severity = none
# Add missing cases to switch expression (IDE0072 and IDE0010)
# a problem with roslyn: https://github.com/dotnet/roslyn/issues/48876
dotnet_diagnostic.IDE0072.severity = none
dotnet_diagnostic.IDE0010.severity = none
# CA1834: Use StringBuilder.Append(char) for single character strings
dotnet_diagnostic.CA1834.severity = none
# CA1805: Do not initialize unnecessarily.
dotnet_diagnostic.CA1805.severity = none
# Use pattern matching (not operator) (IDE0083)
dotnet_diagnostic.IDE0083.severity = none
# CA1309: Use ordinal StringComparison
dotnet_diagnostic.CA1309.severity = none
# CA1000: Do not declare static members on generic types
dotnet_diagnostic.CA1000.severity = none
# RCS1018: Add accessibility modifiers
dotnet_diagnostic.RCS1018.severity = none
# IDE0130: Namespace does not correspond to file location
dotnet_diagnostic.IDE0130.severity = none
# IDE0058: Remove unnecessary expression value
dotnet_diagnostic.IDE0058.severity = none
# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = none
# IDE0160: Convert to file-scoped namespace
csharp_style_namespace_declarations = file_scoped:warning
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = true:error
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
# use 'new' when possible
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
# curly bois preferred on multiline
csharp_prefer_braces = when_multiline:error
# we're ok with both old and new types of switches
csharp_style_prefer_switch_expression = true:none
# allow both => and regular blocks {}
csharp_style_expression_bodied_methods = true:none
csharp_style_expression_bodied_operators = true:none
csharp_style_expression_bodied_constructors = true:none
csharp_style_expression_bodied_local_functions = true:none
csharp_style_expression_bodied_accessors = true:none
# allow both local and anonymous functions
csharp_style_pattern_local_over_anonymous_function = false:none
# dont need to save everything to a var
csharp_style_unused_value_expression_statement_preference = discard_variable
# not ready for changing everything to pattern matching
csharp_style_prefer_pattern_matching = false:none
csharp_using_directive_placement = outside_namespace:error
csharp_style_prefer_range_operator = false:none
# CSharp formatting rules:
# dont want these bombing the build logs, will still show up in the IDE
dotnet_diagnostic.IDE0055.severity = none
# prefere brace indentation when creating objects etc
csharp_indent_braces = false
resharper_remove_redundant_braces_highlighting = none