-
-
Notifications
You must be signed in to change notification settings - Fork 846
Expand file tree
/
Copy pathTest.ruleset
More file actions
88 lines (88 loc) · 5.44 KB
/
Copy pathTest.ruleset
File metadata and controls
88 lines (88 loc) · 5.44 KB
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
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Autofac Analyzer Rules" Description="Analyzer rules for Autofac assemblies." ToolsVersion="16.0">
<IncludeAll Action="Warning" />
<Rules AnalyzerId="Microsoft.Usage" RuleNamespace="Microsoft.Usage">
<!-- Avoid excessive parameters on generic types (must be explicitly enabled). -->
<Rule Id="CA1005" Action="Warning" />
<!-- Don't catch general exceptions - test scenarios sometimes require general exception handling. -->
<Rule Id="CA1031" Action="None" />
<!-- Implement standard exception constructors - not all of the exception constructors (e.g., parameterless) are desired in our system. -->
<Rule Id="CA1032" Action="None" />
<!-- Avoid empty interfaces - in unit tests for service resolution, this happens a lot. -->
<Rule Id="CA1040" Action="None" />
<!-- Do not pass literals as localized parameters - tests don't need to localize. -->
<Rule Id="CA1303" Action="None" />
<!-- Avoid excessive inheritance (must be explicitly enabled). -->
<Rule Id="CA1501" Action="Warning" />
<!-- Avoid excessive complexity (must be explicitly enabled). -->
<Rule Id="CA1502" Action="Warning" />
<!-- Avoid unmaintainable code (must be explicitly enabled). -->
<Rule Id="CA1505" Action="Warning" />
<!-- Avoid excessive class coupling (must be explicitly enabled). -->
<Rule Id="CA1506" Action="Warning" />
<!-- Use ArgumentNullException.ThrowIfNull - this isn't available until we stop targeting netstandard. -->
<Rule Id="CA1510" Action="None" />
<!-- Remove the underscores from member name - unit test scenarios may use underscores. -->
<Rule Id="CA1707" Action="None" />
<!-- Change names to avoid reserved word overlaps (e.g., Delegate, GetType, etc.) - too many of these in the public API, we'd break if we fixed it. -->
<Rule Id="CA1716" Action="None" />
<!-- Internal class that appears to never be instantiated - lots of false positives here because they're test stubs created by Autofac registrations. -->
<Rule Id="CA1812" Action="None" />
<!-- Change Dispose() to call GC.SuppressFinalize - in tests we don't really care and it can impact readability. -->
<Rule Id="CA1816" Action="None" />
<!-- Mark members static - test methods may not access member data but also can't be static. -->
<Rule Id="CA1822" Action="None" />
<!-- Seal internal types for performance - in tests we don't really care and it gets painful to enforce. -->
<Rule Id="CA1852" Action="None" />
<!-- Prefer static readonly fields over constant array arguments - constant array arguments happen a lot in unit tests for assertions and test setup. -->
<Rule Id="CA1861" Action="None" />
<!-- Cache a CompositeFormat object for use in String.Format - this makes unit tests harder to read, and performance isn't an issue. -->
<Rule Id="CA1863" Action="None" />
<!-- Call ConfigureAwait on tasks - you shouldn't do this in unit test libraries; XUnit has an opposite analyzer. -->
<Rule Id="CA2007" Action="None" />
<!-- Implement serialization constructors - false positive when building .NET Core. -->
<Rule Id="CA2229" Action="None" />
<!-- Use Uri instead of string parameters - strings are easier for testing. -->
<Rule Id="CA2234" Action="None" />
<!-- Mark ISerializable types with SerializableAttribute - false positive when building .NET Core. -->
<Rule Id="CA2237" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<!-- Prefix local calls with this. -->
<Rule Id="SA1101" Action="None" />
<!-- Use built-in type alias. -->
<Rule Id="SA1121" Action="None" />
<!-- Use String.Empty instead of "". -->
<Rule Id="SA1122" Action="None" />
<!-- Enforce order of class members by member type - sometimes putting test classes/data by the test helps. -->
<Rule Id="SA1201" Action="None" />
<!-- Enforce order of class members by member visibility - sometimes putting test classes/data by the test helps. -->
<Rule Id="SA1202" Action="None" />
<!-- Enforce order of static vs. non-static members - sometimes putting test classes/data by the test helps. -->
<Rule Id="SA1204" Action="None" />
<!-- Fields can't start with underscore. -->
<Rule Id="SA1309" Action="None" />
<!-- Elements should be documented. -->
<Rule Id="SA1600" Action="None" />
<!-- Partial items should be documented. -->
<Rule Id="SA1601" Action="None" />
<!-- Enumeration items should be documented. -->
<Rule Id="SA1602" Action="None" />
<!-- Parameter should be documented. -->
<Rule Id="SA1611" Action="None" />
<!-- Parameter documentation must be in the right order. -->
<Rule Id="SA1612" Action="None" />
<!-- Return value must be documented. -->
<Rule Id="SA1615" Action="None" />
<!-- Generic type parameters must be documented. -->
<Rule Id="SA1618" Action="None" />
<!-- Don't copy/paste documentation. -->
<Rule Id="SA1625" Action="None" />
<!-- Private member is unused - tests for reflection require members that may not get used. -->
<Rule Id="IDE0051" Action="None" />
<!-- Private member assigned value never read - tests for reflection require values that may not get used. -->
<Rule Id="IDE0052" Action="None" />
<!-- Remove unused parameter - tests for reflection require parameters that may not get used. -->
<Rule Id="IDE0060" Action="None" />
</Rules>
</RuleSet>