-
Notifications
You must be signed in to change notification settings - Fork 0
/
.editorconfig
117 lines (86 loc) · 4.56 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
# Signature-Code .editorconfig
# See also: https://github.com/dotnet/roslyn/blob/main/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
# 20170522
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.{cs,js,ts,sql,tql}]
indent_size = 4
end_of_line = crlf
[*.cs]
csharp_space_between_method_call_parameter_list_parentheses = true
csharp_space_between_method_declaration_parameter_list_parentheses = true
csharp_space_after_keywords_in_control_flow_statements = false
csharp_space_between_parentheses = control_flow_statements
# Motive: May be weird at first, but it improve readability.
csharp_style_prefer_primary_constructors = false:suggestion
# Primary constructors should be used only for very simple classes. May be record is a good choice.
# internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
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, internal
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Motive: It follow the C# style guideline.
# CA1063: Implement IDisposable Correctly
dotnet_diagnostic.CA1063.severity = none
# CA1816: Dispose methods should call SuppressFinalize
dotnet_diagnostic.CA1816.severity = none
# Motive: These warning is irrelevant because we only use managed objects and we SHOULD always do.
# The dispose pattern (see here https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose) may be useful only in some edge case,
# If you feel like you NEED to handle an unmanaged resource, please let's talk about this first: it may well be a bad idea...
# and most of the time (99.99...%) a simple IDisposable implementation IS okay.
# IDE0063: Use simple 'using' statement.
csharp_prefer_simple_using_statement = false:none
# Motive: Most of the time, the 'not simple' using scope is better.
# CA1031: Do not catch general exception types.
dotnet_diagnostic.CA1031.severity = none
# IDE0057: Use range operator.
csharp_style_prefer_range_operator = false:suggestion
# Motive: Use it if you want but this is should not show a message.
# IDE0060: Remove unused parameter
dotnet_code_quality_unused_parameters = all:silent
# Motive: Emit messages where the parameter are necessary.
# IDE0040: Add accessibility modifiers
dotnet_style_require_accessibility_modifiers = omit_if_default:silent
# Motive: 'private' is one more word that can be omitted.
# CA1034: Nested types should not be visible.
dotnet_diagnostic.CA1034.severity = none
# Motive: Nested types can be used to design a good API.
# CA1040: Avoid empty interfaces
dotnet_diagnostic.CA1040.severity = none
# Motive: Empty interfaces are "interface markers" and are very useful.
# CA1508: Avoid dead conditional code
dotnet_diagnostic.CA1508.severity = none
# Motive: Too much false positive: if you follow the suggestion you will remove useful code!
# Has 45 issues open for this analyzers as 21/08/2021
# CA2100: Review SQL queries for security vulnerabilities.
# This is an annoying yet useful warning... for beginners.
dotnet_diagnostic.CA2100.severity = none
# CA2012: Use ValueTasks correctly
dotnet_diagnostic.CA2012.severity=warning
# CA2011: Do not assign property within its setter (avoids StackOverflowException)
dotnet_diagnostic.CA2011.severity=error
# CA1041: Provide ObsoleteAttribute message (without message, the developer is lost!)
dotnet_diagnostic.CA1041.severity=error
# CA1068: CancellationToken parameters must come last
dotnet_diagnostic.CA1068.severity=warning
# CA2016: Forward the CancellationToken parameter to methods that take one.
dotnet_diagnostic.CA2016.severity=warning
# IDE0090: Use 'new(...)' if you want but it's ok if you don't.
dotnet_diagnostic.IDE0090.severity = none
# <PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.0.64">
# <PrivateAssets>all</PrivateAssets>
# <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
# </PackageReference>
# VSTHRD101: Avoid unsupported async delegates
dotnet_diagnostic.VSTHRD101.severity = error
# VSTHRD003: Avoid awaiting foreign Tasks
dotnet_diagnostic.VSTHRD003.severity = none
# /Signature-Code .editorconfig