-
Notifications
You must be signed in to change notification settings - Fork 37
/
.globalconfig
229 lines (188 loc) · 12.1 KB
/
.globalconfig
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# Global AnalyzerConfig file
# For details: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files
# For rules: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
is_global = true
global_level = 1
# Language code styles
# Most use "options_name = false|true : none|silent|suggestion|warning|error"
# .NET code style settings
# "This." and "Me." qualifiers
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
# Language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
csharp_prefer_static_local_function = true:error
dotnet_style_readonly_field = true:suggestion
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = false:silent
# "Null" checking preferences
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# C# code style settings
# Implicit and explicit types
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion
# 'new(...)' ctor
csharp_style_implicit_object_creation_when_type_is_apparent = false
# Expression-bodied members
csharp_style_expression_bodied_constructors = when_on_single_line:suggestion
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Inlined variable declarations
csharp_style_inlined_variable_declaration = true:suggestion
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = false:suggestion
# "Null" checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Code block preferences
csharp_prefer_braces = when_multiline:error
# Namespaces
csharp_style_namespace_declarations = file_scoped:error
# Formatting conventions
# Most use "rule_name = false|true"
# .NET formatting settings
# Organize usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# C# formatting settings
# Newline options
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
csharp_new_line_between_query_expression_clauses = true
# Indentation options
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = no_change
# Spacing options
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping options
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
# Naming conventions ("borrowed" from CoreFX)
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
# name all static readonly fields using PascalCase
dotnet_naming_rule.static_readonly_fields_pascal_case.severity = error
dotnet_naming_rule.static_readonly_fields_pascal_case.symbols = static_readonly_fields
dotnet_naming_rule.static_readonly_fields_pascal_case.style = pascal_case_style
dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.static_readonly_fields.required_modifiers = readonly,static
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# static fields should have s_ prefix
dotnet_naming_rule.static_private_internal_fields_should_have_prefix.severity = error
dotnet_naming_rule.static_private_internal_fields_should_have_prefix.symbols = static_private_internal_fields
dotnet_naming_rule.static_private_internal_fields_should_have_prefix.style = static_prefix_style
dotnet_naming_symbols.static_private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.static_private_internal_fields.applicable_accessibilities = private
dotnet_naming_symbols.static_private_internal_fields.required_modifiers = static
dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.capitalization = camel_case
# internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = error
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Analyzers
# See https://github.com/dotnet/roslyn-analyzers/blob/master/docs/Analyzer%20Configuration.md
# Note that the above severities do not affect builds by design. These values are only used
# to configure the entries in Visual Studio's "Error List" and power its Intellisense.
# Instead, the rules below are used to configure build-time analyzer behavior.
# Unfortunately, some rules have been disabled due to performance reasons outside of
# Visual Studio and can be found here:
# https://github.com/dotnet/roslyn/blob/0a73f08951f408624639e1601bb828b396f154c8/src/Analyzers/Core/Analyzers/EnforceOnBuildValues.cs#L99
# Code Quality Rules
dotnet_code_quality.api_surface = all
dotnet_code_quality.exclude_async_void_methods = true
dotnet_code_quality.exclude_single_letter_type_parameters = true
dotnet_code_quality.dispose_analysis_kind = AllPaths
dotnet_code_quality.enum_values_prefix_trigger = AllEnumValues
dotnet_code_quality.exclude_indirect_base_types = false
dotnet_code_quality.CA1002.api_surface = public # Do not expose generic lists
dotnet_code_quality.CA1062.api_surface = public # Validate arguments of public methods
dotnet_code_quality.CA1802 = static # Use Literals Where Appropriate
dotnet_diagnostic.CA1031.severity = error # Do not catch general exception types
dotnet_diagnostic.CA1032.severity = suggestion # Implement standard exception constructors
dotnet_diagnostic.CA1054.severity = error # URI parameters should not be strings
dotnet_diagnostic.CA1305.severity = error # Specify IFormatProvider
dotnet_diagnostic.CA1716.severity = error # Identifiers should not match keywords
dotnet_diagnostic.CA1822.severity = error # Mark members as static
dotnet_diagnostic.CA1848.severity = none # Do not encourage LoggerMessage delegates in every instance
dotnet_diagnostic.CA2007.severity = error # Do not directly await a Task
# C# Compiler Rules
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
# Code Style Rules
dotnet_diagnostic.IDE0003.severity = error # Remove this or Me qualification
dotnet_diagnostic.IDE0004.severity = error # Remove unnecessary cast
dotnet_diagnostic.IDE0005.severity = error # Remove unnecessary import
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement
dotnet_diagnostic.IDE0021.severity = none # Use expression body for constructors
dotnet_diagnostic.IDE0022.severity = none # Use expression body for methods
dotnet_diagnostic.IDE0023.severity = none # Use expression body for conversion operators
dotnet_diagnostic.IDE0024.severity = none # Use expression body for operators
dotnet_diagnostic.IDE0025.severity = none # Use expression body for properties
dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers
dotnet_diagnostic.IDE0027.severity = none # Use expression body for accessors
dotnet_diagnostic.IDE0032.severity = error # Use auto property
dotnet_diagnostic.IDE0044.severity = error # Add readonly modifier
dotnet_diagnostic.IDE0053.severity = none # Use expression body for lambdas
dotnet_diagnostic.IDE0055.severity = error # Fix formatting
dotnet_diagnostic.IDE0061.severity = none # Use expression body for local functions
dotnet_diagnostic.IDE0062.severity = error # Make local function static
dotnet_diagnostic.IDE0065.severity = error # 'using' directive placement
dotnet_diagnostic.IDE0073.severity = error # Require file header
dotnet_diagnostic.IDE0161.severity = error # Use file-scoped namespace
dotnet_diagnostic.IDE1005.severity = error # Use conditional delegate call
dotnet_diagnostic.IDE1006.severity = error # Naming rule violation