microsoft/TypeAgent

Public

mirrored fromhttps://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/refactor-input-completion-code

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

dotnet/.editorconfig

421lines · modecode

1# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2
3###############################
4# Core EditorConfig Options #
5###############################
6root = true
7
8# All files
9[*]
10indent_style = space
11end_of_line = lf
12
13# XML project files
14[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
15indent_size = 2
16
17# XML config files
18[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
19indent_size = 2
20
21# YAML config files
22[*.{yml,yaml}]
23tab_width = 2
24indent_size = 2
25insert_final_newline = true
26trim_trailing_whitespace = true
27
28# JSON config files
29[*.json]
30tab_width = 2
31indent_size = 2
32insert_final_newline = false
33trim_trailing_whitespace = true
34
35# Typescript files
36[*.{ts,tsx}]
37insert_final_newline = true
38trim_trailing_whitespace = true
39tab_width = 4
40indent_size = 4
41file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
42
43# Stylesheet files
44[*.{css,scss,sass,less}]
45insert_final_newline = true
46trim_trailing_whitespace = true
47tab_width = 4
48indent_size = 4
49
50# Code files
51[*.{cs,csx,vb,vbx}]
52tab_width = 4
53indent_size = 4
54insert_final_newline = true
55trim_trailing_whitespace = true
56charset = utf-8
57file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
58
59###############################
60# .NET Coding Conventions #
61###############################
62[*.{cs,vb}]
63# Organize usings
64dotnet_sort_system_directives_first = true
65# this. preferences
66dotnet_style_qualification_for_field = false:none
67dotnet_style_qualification_for_property = false:none
68dotnet_style_qualification_for_method = false:none
69dotnet_style_qualification_for_event = false:none
70# Language keywords vs BCL types preferences
71dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
72dotnet_style_predefined_type_for_member_access = true:suggestion
73# Parentheses preferences
74dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
75dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
76dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
77dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
78# Modifier preferences
79dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
80dotnet_style_readonly_field = true:suggestion
81# Expression-level preferences
82dotnet_style_object_initializer = true:suggestion
83dotnet_style_collection_initializer = true:suggestion
84dotnet_style_explicit_tuple_names = true:suggestion
85dotnet_style_null_propagation = true:suggestion
86dotnet_style_coalesce_expression = true:suggestion
87dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
88dotnet_style_prefer_inferred_tuple_names = true:suggestion
89dotnet_style_prefer_inferred_anonymous_type_member_names = true:silent
90dotnet_style_prefer_auto_properties = true:suggestion
91dotnet_style_prefer_conditional_expression_over_assignment = true:silent
92dotnet_style_prefer_conditional_expression_over_return = true:silent
93dotnet_style_prefer_simplified_interpolation = true:suggestion
94dotnet_style_operator_placement_when_wrapping = beginning_of_line
95dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
96dotnet_style_prefer_compound_assignment = true:suggestion
97# Code quality rules
98dotnet_code_quality_unused_parameters = all:suggestion
99dotnet_style_namespace_match_folder = true:suggestion
100dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
101dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
102dotnet_style_allow_multiple_blank_lines_experimental = true:silent
103
104[*.cs]
105
106dotnet_analyzer_diagnostic.severity = warning
107
108# Note: these settings cause "dotnet format" to fix the code. You should review each change if you uses "dotnet format".
109dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line.
110dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space.
111dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call.
112dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment.
113dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment.
114dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'.
115dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'.
116dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal.
117dotnet_diagnostic.RCS1194.severity = warning # Implement exception constructors.
118dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause.
119dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string.
120dotnet_diagnostic.RCS1225.severity = warning # Make class sealed.
121dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment.
122
123
124# Commented out because `dotnet format` removes the xmldoc element, while we should add the missing documentation instead.
125# dotnet_diagnostic.RCS1228.severity = warning # Unused element in documentation comment.
126
127# Diagnostics elevated as warnings
128# dotnet_diagnostic.CA1000.severity = warning # Do not declare static members on generic types
129# dotnet_diagnostic.CA1031.severity = warning # Do not catch general exception types
130dotnet_diagnostic.CA1050.severity = warning # Declare types in namespaces
131dotnet_diagnostic.CA1063.severity = warning # Implement IDisposable correctly
132dotnet_diagnostic.CA1064.severity = warning # Exceptions should be public
133dotnet_diagnostic.CA1310.severity = none # Exceptions should be public
134dotnet_diagnostic.CA1416.severity = warning # Validate platform compatibility
135dotnet_diagnostic.CA1508.severity = warning # Avoid dead conditional code
136# dotnet_diagnostic.CA1852.severity = warning # Sealed classes
137dotnet_diagnostic.CA1859.severity = warning # Use concrete types when possible for improved performance
138dotnet_diagnostic.CA1860.severity = warning # Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
139# dotnet_diagnostic.CA2000.severity = warning # Call System.IDisposable.Dispose on object before all references to it are out of scope
140dotnet_diagnostic.CA2201.severity = warning # Exception type System.Exception is not sufficiently specific
141
142dotnet_diagnostic.IDE0001.severity = warning # Simplify name
143# dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives
144dotnet_diagnostic.IDE0011.severity = warning # Add braces
145dotnet_diagnostic.IDE0018.severity = warning # Inline variable declaration
146dotnet_diagnostic.IDE0032.severity = warning # Use auto-implemented property
147dotnet_diagnostic.IDE0034.severity = warning # Simplify 'default' expression
148dotnet_diagnostic.IDE0035.severity = warning # Remove unreachable code
149dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references
150dotnet_diagnostic.IDE0050.severity = warning # Convert anonymous type to tuple
151dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
152dotnet_diagnostic.IDE0055.severity = warning # Formatting rule
153dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter
154dotnet_diagnostic.IDE0070.severity = warning # Use 'System.HashCode.Combine'
155dotnet_diagnostic.IDE0071.severity = warning # Simplify interpolation
156dotnet_diagnostic.IDE0073.severity = warning # Require file header
157dotnet_diagnostic.IDE0082.severity = warning # Convert typeof to nameof
158# dotnet_diagnostic.IDE0130.severity = warning # Namespace does not match folder structure
159dotnet_diagnostic.IDE0161.severity = warning # Use file-scoped namespace
160
161#######################################
162#
163# Suppressed diagnostics
164#
165#######################################
166dotnet_diagnostic.RCS1085.severity = none # Use auto-implemented property.
167
168dotnet_diagnostic.CA1002.severity = none # Change 'List<string>' in '...' to use 'Collection<T>' ...
169dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to cover more ctors
170dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible
171dotnet_diagnostic.CA1036.severity = none # IComparable
172dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
173dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters
174dotnet_diagnostic.CA1304.severity = none # Specify CultureInfo
175dotnet_diagnostic.CA1305.severity = none # Specify IFormatProvider
176dotnet_diagnostic.CA1311.severity = none # Specify a culture or use an invariant version
177dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
178dotnet_diagnostic.CA1707.severity = none # Identifiers should not contain underscores
179dotnet_diagnostic.CA1711.severity = none # Identifiers should not have incorrect suffix
180dotnet_diagnostic.CA1716.severity = none # Identifiers should not match keywords
181dotnet_diagnostic.CA1720.severity = none #
182dotnet_diagnostic.CA1725.severity = none # Parameter names should match base declaration
183dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value
184dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static
185dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates
186dotnet_diagnostic.CA1852.severity = none # Seal internal types
187dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task
188dotnet_diagnostic.CA2208.severity = none #
189dotnet_diagnostic.CA2225.severity = none # Operator overloads have named alternates
190dotnet_diagnostic.CA2227.severity = none # Change to be read-only by removing the property setter
191dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters
192
193dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave
194dotnet_diagnostic.xUnit1004.severity = none # Test methods should not be skipped. Remove the Skip property to start running the test again.
195
196dotnet_diagnostic.RCS1021.severity = none # Use expression-bodied lambda.
197dotnet_diagnostic.RCS1032.severity = none # Remove redundant parentheses.
198dotnet_diagnostic.RCS1061.severity = none # Merge 'if' with nested 'if'.
199dotnet_diagnostic.RCS1069.severity = none # Remove unnecessary case label.
200dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor.
201dotnet_diagnostic.RCS1077.severity = none # Optimize LINQ method call.
202dotnet_diagnostic.RCS1118.severity = none # Mark local variable as const.
203dotnet_diagnostic.RCS1124.severity = none # Inline local variable.
204dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization.
205dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment.
206dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment.
207dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment.
208dotnet_diagnostic.RCS1146.severity = none # Use conditional access.
209dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast.
210dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter.
211dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit value
212dotnet_diagnostic.RCS1163.severity = none # Unused parameter 'foo'.
213dotnet_diagnostic.RCS1170.severity = none # Use read-only auto-implemented property.
214dotnet_diagnostic.RCS1173.severity = none # Use coalesce expression instead of 'if'.
215dotnet_diagnostic.RCS1181.severity = none # Convert comment to documentation comment.
216dotnet_diagnostic.RCS1186.severity = none # Use Regex instance instead of static method.
217dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initialization.
218dotnet_diagnostic.RCS1189.severity = none # Add region name to #endregion.
219dotnet_diagnostic.RCS1197.severity = none # Optimize StringBuilder.AppendLine call.
220dotnet_diagnostic.RCS1201.severity = none # Use method chaining.
221dotnet_diagnostic.RCS1205.severity = none # Order named arguments according to the order of parameters.
222dotnet_diagnostic.RCS1212.severity = none # Remove redundant assignment.
223dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation.
224dotnet_diagnostic.RCS1222.severity = none # Merge preprocessor directives.
225dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment.
226dotnet_diagnostic.RCS1229.severity = none # Use async/await when necessary.
227dotnet_diagnostic.RCS1234.severity = none # Enum duplicate value
228dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators.
229dotnet_diagnostic.RCS1241.severity = none # Implement IComparable when implementing IComparable<T><T>.
230
231dotnet_diagnostic.IDE0001.severity = none # Simplify name
232dotnet_diagnostic.IDE0002.severity = none # Simplify member access
233dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast
234dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives
235dotnet_diagnostic.IDE0009.severity = none # Add this or Me qualification
236dotnet_diagnostic.IDE1006.severity = none # Naming rule violation (allow Win32 conventions)
237dotnet_diagnostic.IDE0010.severity = none # Populate switch
238dotnet_diagnostic.IDE0017.severity = none # Object initializers
239dotnet_diagnostic.IDE0022.severity = none # Use block body for method
240dotnet_diagnostic.IDE0032.severity = none # Use auto property
241dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code
242dotnet_diagnostic.IDE0040.severity = none # Add accessibility modifiers
243dotnet_diagnostic.IDE0044.severity = none # Make field readonly
244dotnet_diagnostic.IDE0051.severity = none # Remove unused private member
245dotnet_diagnostic.IDE0052.severity = none # Remove unread private member
246dotnet_diagnostic.IDE0058.severity = none # Remove unused expression value
247dotnet_diagnostic.IDE0059.severity = none # Unnecessary assignment of a value
248dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter
249dotnet_diagnostic.IDE0061.severity = none # Use expression body for local functions
250dotnet_diagnostic.IDE0072.severity = none
251dotnet_diagnostic.IDE0078.severity = none # Use pattern matching
252dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator
253dotnet_diagnostic.IDE0090.severity = none # Simplify new expression
254dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator
255dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discards
256dotnet_diagnostic.IDE00130.severity = none #
257dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace
258
259dotnet_diagnostic.IDE0251.severity = none
260dotnet_diagnostic.IDE0290.severity = none
261
262###############################
263# Naming Conventions #
264###############################
265
266# Styles
267
268dotnet_naming_style.pascal_case_style.capitalization = pascal_case
269
270dotnet_naming_style.camel_case_style.capitalization = camel_case
271
272dotnet_naming_style.static_underscored.capitalization = camel_case
273dotnet_naming_style.static_underscored.required_prefix = s_
274
275dotnet_naming_style.underscored.capitalization = camel_case
276dotnet_naming_style.underscored.required_prefix = _
277
278dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper
279dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _
280
281dotnet_naming_style.end_in_async.required_prefix =
282dotnet_naming_style.end_in_async.required_suffix = Async
283dotnet_naming_style.end_in_async.capitalization = pascal_case
284dotnet_naming_style.end_in_async.word_separator =
285
286# Symbols
287
288dotnet_naming_symbols.constant_fields.applicable_kinds = field
289dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
290dotnet_naming_symbols.constant_fields.required_modifiers = const
291
292dotnet_naming_symbols.local_constant.applicable_kinds = local
293dotnet_naming_symbols.local_constant.applicable_accessibilities = *
294dotnet_naming_symbols.local_constant.required_modifiers = const
295
296dotnet_naming_symbols.private_static_fields.applicable_kinds = field
297dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
298dotnet_naming_symbols.private_static_fields.required_modifiers = static
299
300dotnet_naming_symbols.private_fields.applicable_kinds = field
301dotnet_naming_symbols.private_fields.applicable_accessibilities = private
302
303dotnet_naming_symbols.any_async_methods.applicable_kinds = method
304dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
305dotnet_naming_symbols.any_async_methods.required_modifiers = async
306
307# Rules
308
309dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
310dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
311dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
312
313dotnet_naming_rule.local_constant_should_be_pascal_case.symbols = local_constant
314dotnet_naming_rule.local_constant_should_be_pascal_case.style = pascal_case_style
315dotnet_naming_rule.local_constant_should_be_pascal_case.severity = suggestion
316
317dotnet_naming_rule.private_static_fields_underscored.symbols = private_static_fields
318dotnet_naming_rule.private_static_fields_underscored.style = static_underscored
319dotnet_naming_rule.private_static_fields_underscored.severity = error
320
321dotnet_naming_rule.private_fields_underscored.symbols = private_fields
322dotnet_naming_rule.private_fields_underscored.style = underscored
323dotnet_naming_rule.private_fields_underscored.severity = error
324
325dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
326dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
327dotnet_naming_rule.async_methods_end_in_async.severity = error
328
329###############################
330# C# Coding Conventions #
331###############################
332
333# var preferences
334csharp_style_var_for_built_in_types = false:none
335csharp_style_var_when_type_is_apparent = false:none
336csharp_style_var_elsewhere = false:none
337# Expression-bodied members
338csharp_style_expression_bodied_methods = false:silent
339csharp_style_expression_bodied_constructors = false:silent
340csharp_style_expression_bodied_operators = false:silent
341csharp_style_expression_bodied_properties = true:silent
342csharp_style_expression_bodied_indexers = true:silent
343csharp_style_expression_bodied_accessors = true:silent
344# Pattern matching preferences
345csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
346csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
347# Null-checking preferences
348csharp_style_throw_expression = true:suggestion
349csharp_style_conditional_delegate_call = true:suggestion
350# Modifier preferences
351csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
352# Expression-level preferences
353csharp_prefer_braces = true:error
354csharp_style_deconstructed_variable_declaration = true:suggestion
355csharp_prefer_simple_default_expression = true:suggestion
356csharp_style_prefer_local_over_anonymous_function = true:error
357csharp_style_inlined_variable_declaration = true:suggestion
358
359###############################
360# C# Formatting Rules #
361###############################
362
363# New line preferences
364csharp_new_line_before_open_brace = all
365csharp_new_line_before_else = true
366csharp_new_line_before_catch = true
367csharp_new_line_before_finally = true
368csharp_new_line_before_members_in_object_initializers = false # Does not work with resharper, forcing code to be on long lines instead of wrapping
369csharp_new_line_before_members_in_anonymous_types = true
370csharp_new_line_between_query_expression_clauses = true
371# Indentation preferences
372csharp_indent_braces = false
373csharp_indent_case_contents = true
374csharp_indent_case_contents_when_block = false
375csharp_indent_switch_labels = true
376csharp_indent_labels = flush_left
377# Space preferences
378csharp_space_after_cast = false
379csharp_space_after_keywords_in_control_flow_statements = true
380csharp_space_between_method_call_parameter_list_parentheses = false
381csharp_space_between_method_declaration_parameter_list_parentheses = false
382csharp_space_between_parentheses = false
383csharp_space_before_colon_in_inheritance_clause = true
384csharp_space_after_colon_in_inheritance_clause = true
385csharp_space_around_binary_operators = before_and_after
386csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
387csharp_space_between_method_call_name_and_opening_parenthesis = false
388csharp_space_between_method_call_empty_parameter_list_parentheses = false
389# Wrapping preferences
390csharp_preserve_single_line_statements = true
391csharp_preserve_single_line_blocks = true
392csharp_using_directive_placement = outside_namespace:warning
393csharp_prefer_simple_using_statement = true:suggestion
394csharp_style_namespace_declarations = file_scoped:warning
395csharp_style_prefer_method_group_conversion = true:silent
396csharp_style_prefer_top_level_statements = true:silent
397csharp_style_expression_bodied_lambdas = true:silent
398csharp_style_expression_bodied_local_functions = false:silent
399csharp_style_prefer_primary_constructors = true:suggestion
400csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
401csharp_style_prefer_range_operator = true:suggestion
402csharp_style_prefer_index_operator = true:suggestion
403csharp_style_prefer_null_check_over_type_check = true:suggestion
404csharp_style_unused_value_expression_statement_preference = discard_variable:silent
405csharp_style_unused_value_assignment_preference = discard_variable:suggestion
406csharp_style_prefer_utf8_string_literals = true:suggestion
407csharp_style_prefer_tuple_swap = true:suggestion
408csharp_style_prefer_readonly_struct_member = true:suggestion
409csharp_style_prefer_readonly_struct = true:suggestion
410csharp_prefer_static_anonymous_function = true:suggestion
411csharp_prefer_static_local_function = true:suggestion
412csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
413csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
414csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
415csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
416csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
417csharp_style_prefer_pattern_matching = true:silent
418csharp_style_prefer_switch_expression = true:suggestion
419csharp_style_prefer_extended_property_pattern = true:suggestion
420csharp_style_prefer_not_pattern = true:suggestion
421
422