|
| 1 | +# 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 |
| 42 | +dotnet_diagnostic.S4581.severity = suggestion |
0 commit comments