You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Analyzers and fix TestsRuleset package (#17)
- Fixed TestsRuleset package so the main `.globalconfig` is inherited and then overwritten by the tests-specific rules and not the other way around
- Updated `SonarAnalyzer.CSharp` to latest minor version (8.56.0.67649)
- Changed from `StyleCop.Analyzers` package to `StyleCop.Analyzers.Unstable` and update to latest available version (1.2.0.556)
- Changed `.globalconfig` file names to match NuGet package names as recommended by Microsoft
- Currently active `.globalconfig` is now linked in the solution explorer and therefore quickly accessible from within the IDE
# Top level entry required to mark this as a global AnalyzerConfig file
2
+
# NOTE: Do not create section headers for configuration entries
3
+
is_global = true
4
+
5
+
# For conflicting rules, the higher level has higher priority
6
+
global_level = 101
7
+
8
+
#############################################
9
+
########## Rules specific to tests ##########
10
+
#############################################
11
+
12
+
# CA1707: Identifiers should not contain underscores
13
+
; We use underscores in test method names to make them easier to read.
14
+
dotnet_diagnostic.CA1707.severity = none
15
+
16
+
# CA1031: Do not catch general exception types
17
+
; Since we can raise any Exception we like In Tests we should also be able to catch any Exception we like.
18
+
dotnet_diagnostic.CA1031.severity = none
19
+
20
+
# CA2000: Dispose objects before losing scope
21
+
; Tests are never run continuously in a production environment. Resources are freed as soon as the Test run ends, so there is no need to worry about the pitfalls of not freeing resources.
22
+
dotnet_diagnostic.CA2000.severity = none
23
+
24
+
# CA2007: Consider calling ConfigureAwait on the awaited task
25
+
; This warning is intended for libraries, where the code may be executed in arbitrary environments and where code shouldn't make assumptions about the environment or how the caller of the method may be invoking or waiting on it
26
+
dotnet_diagnostic.CA2007.severity = none
27
+
28
+
# S112: General exceptions should never be thrown
29
+
; In Tests we should be able to raise any Exception we like.
30
+
dotnet_diagnostic.S112.severity = none
31
+
32
+
# S131: "switch/Select" statements should contain a "default/Case Else" clauses
33
+
; There is no need for defensive programming in Tests
34
+
dotnet_diagnostic.S131.severity = none
35
+
36
+
# S126: "if ... else if" constructs should end with "else" clauses
37
+
; There is no need for defensive programming in Tests
38
+
dotnet_diagnostic.S126.severity = none
39
+
40
+
# S4581: "new Guid()" should not be used
41
+
; When creating mocks/substitutes this can be irrelevant, so it should not break the build
Copy file name to clipboardExpand all lines: build/Neolution.CodeAnalysis.globalconfig
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
-
# Top level entry required to mark this as a global AnalyzerConfig file
1
+
# Top level entry required to mark this as a global AnalyzerConfig file
2
2
# NOTE: Do not create section headers for configuration entries
3
3
is_global = true
4
4
5
+
# For conflicting rules, the higher level has higher priority
6
+
global_level = 100
7
+
5
8
# Literals should not be passed as localized parameters
6
9
; Localization is not needed in every project and for every message. This rule disallows string literals everywhere e.g. for log messages, content that does not need to be translated etc.
0 commit comments