Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit b4636c7

Browse files
committed
Add StyleCop Analyzers configuration from DotNetAnalyzers/StyleCopAnalyzers
1 parent d5fb375 commit b4636c7

File tree

6 files changed

+164
-8
lines changed

6 files changed

+164
-8
lines changed

AsyncUsageAnalyzers/AsyncUsageAnalyzers.CodeFixes/AsyncUsageAnalyzers.CodeFixes.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
26-
<DocumentationFile>bin\Debug\AsyncUsageAnalyzers.CodeFixes.xml</DocumentationFile>
2726
</PropertyGroup>
2827
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2928
<DebugType>pdbonly</DebugType>
@@ -32,7 +31,10 @@
3231
<DefineConstants>TRACE</DefineConstants>
3332
<ErrorReport>prompt</ErrorReport>
3433
<WarningLevel>4</WarningLevel>
35-
<DocumentationFile>bin\Release\AsyncUsageAnalyzers.CodeFixes.xml</DocumentationFile>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
37+
<CodeAnalysisRuleSet>..\AsyncUsageAnalyzers.ruleset</CodeAnalysisRuleSet>
3638
</PropertyGroup>
3739
<PropertyGroup>
3840
<SignAssembly>true</SignAssembly>
@@ -72,6 +74,11 @@
7274
</None>
7375
<None Include="ReadMe.txt" />
7476
</ItemGroup>
77+
<ItemGroup>
78+
<AdditionalFiles Include="..\stylecop.json">
79+
<Link>stylecop.json</Link>
80+
</AdditionalFiles>
81+
</ItemGroup>
7582
<ItemGroup>
7683
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7784
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.dll</HintPath>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules for AsyncUsageAnalyzers internal-only projects" Description="Code analysis rules for AsyncUsageAnalyzers internal-only projects." ToolsVersion="14.0">
3+
<Include Path="AsyncUsageAnalyzers.ruleset" Action="Default" />
4+
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
5+
<Rule Id="CS1573" Action="Hidden" />
6+
<Rule Id="CS1591" Action="Hidden" />
7+
<Rule Id="CS2008" Action="None" />
8+
</Rules>
9+
</RuleSet>

AsyncUsageAnalyzers/AsyncUsageAnalyzers.Test/AsyncUsageAnalyzers.Test.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
<ErrorReport>prompt</ErrorReport>
2626
<WarningLevel>4</WarningLevel>
2727
<Prefer32Bit>false</Prefer32Bit>
28-
<DocumentationFile>bin\Debug\AsyncUsageAnalyzers.Test.xml</DocumentationFile>
29-
<NoWarn>1591</NoWarn>
3028
</PropertyGroup>
3129
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3230
<DebugType>pdbonly</DebugType>
@@ -36,8 +34,10 @@
3634
<ErrorReport>prompt</ErrorReport>
3735
<WarningLevel>4</WarningLevel>
3836
<Prefer32Bit>false</Prefer32Bit>
39-
<DocumentationFile>bin\Release\AsyncUsageAnalyzers.Test.xml</DocumentationFile>
40-
<NoWarn>1591</NoWarn>
37+
</PropertyGroup>
38+
<PropertyGroup>
39+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
40+
<CodeAnalysisRuleSet>..\AsyncUsageAnalyzers.Internal.ruleset</CodeAnalysisRuleSet>
4141
</PropertyGroup>
4242
<PropertyGroup>
4343
<SignAssembly>true</SignAssembly>
@@ -134,6 +134,11 @@
134134
<ItemGroup>
135135
<None Include="packages.config" />
136136
</ItemGroup>
137+
<ItemGroup>
138+
<AdditionalFiles Include="..\stylecop.json">
139+
<Link>stylecop.json</Link>
140+
</AdditionalFiles>
141+
</ItemGroup>
137142
<ItemGroup>
138143
<ProjectReference Include="..\AsyncUsageAnalyzers.CodeFixes\AsyncUsageAnalyzers.CodeFixes.csproj">
139144
<Project>{ba0cd420-1e79-4fbc-b023-09c03bcdffac}</Project>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules for AsyncUsageAnalyzers" Description="Code analysis rules for AsyncUsageAnalyzers.csproj." ToolsVersion="14.0">
3+
<Rules AnalyzerId="AsyncUsageAnalyzers" RuleNamespace="AsyncUsageAnalyzers">
4+
<Rule Id="AvoidAsyncSuffix" Action="Error" />
5+
<Rule Id="AvoidAsyncVoid" Action="Error" />
6+
<Rule Id="UseAsyncSuffix" Action="Error" />
7+
<Rule Id="UseConfigureAwait" Action="Error" />
8+
</Rules>
9+
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
10+
<Rule Id="CA1001" Action="Warning" />
11+
<Rule Id="CA1009" Action="Warning" />
12+
<Rule Id="CA1016" Action="Warning" />
13+
<Rule Id="CA1033" Action="Warning" />
14+
<Rule Id="CA1049" Action="Warning" />
15+
<Rule Id="CA1060" Action="Warning" />
16+
<Rule Id="CA1061" Action="Warning" />
17+
<Rule Id="CA1063" Action="Warning" />
18+
<Rule Id="CA1065" Action="Warning" />
19+
<Rule Id="CA1301" Action="Warning" />
20+
<Rule Id="CA1400" Action="Warning" />
21+
<Rule Id="CA1401" Action="Warning" />
22+
<Rule Id="CA1403" Action="Warning" />
23+
<Rule Id="CA1404" Action="Warning" />
24+
<Rule Id="CA1405" Action="Warning" />
25+
<Rule Id="CA1410" Action="Warning" />
26+
<Rule Id="CA1415" Action="Warning" />
27+
<Rule Id="CA1821" Action="Warning" />
28+
<Rule Id="CA1900" Action="Warning" />
29+
<Rule Id="CA1901" Action="Warning" />
30+
<Rule Id="CA2002" Action="Warning" />
31+
<Rule Id="CA2100" Action="Warning" />
32+
<Rule Id="CA2101" Action="Warning" />
33+
<Rule Id="CA2108" Action="Warning" />
34+
<Rule Id="CA2111" Action="Warning" />
35+
<Rule Id="CA2112" Action="Warning" />
36+
<Rule Id="CA2114" Action="Warning" />
37+
<Rule Id="CA2116" Action="Warning" />
38+
<Rule Id="CA2117" Action="Warning" />
39+
<Rule Id="CA2122" Action="Warning" />
40+
<Rule Id="CA2123" Action="Warning" />
41+
<Rule Id="CA2124" Action="Warning" />
42+
<Rule Id="CA2126" Action="Warning" />
43+
<Rule Id="CA2131" Action="Warning" />
44+
<Rule Id="CA2132" Action="Warning" />
45+
<Rule Id="CA2133" Action="Warning" />
46+
<Rule Id="CA2134" Action="Warning" />
47+
<Rule Id="CA2137" Action="Warning" />
48+
<Rule Id="CA2138" Action="Warning" />
49+
<Rule Id="CA2140" Action="Warning" />
50+
<Rule Id="CA2141" Action="Warning" />
51+
<Rule Id="CA2146" Action="Warning" />
52+
<Rule Id="CA2147" Action="Warning" />
53+
<Rule Id="CA2149" Action="Warning" />
54+
<Rule Id="CA2200" Action="Warning" />
55+
<Rule Id="CA2202" Action="Warning" />
56+
<Rule Id="CA2207" Action="Warning" />
57+
<Rule Id="CA2212" Action="Warning" />
58+
<Rule Id="CA2213" Action="Warning" />
59+
<Rule Id="CA2214" Action="Warning" />
60+
<Rule Id="CA2216" Action="Warning" />
61+
<Rule Id="CA2220" Action="Warning" />
62+
<Rule Id="CA2229" Action="Warning" />
63+
<Rule Id="CA2231" Action="Warning" />
64+
<Rule Id="CA2232" Action="Warning" />
65+
<Rule Id="CA2235" Action="Warning" />
66+
<Rule Id="CA2236" Action="Warning" />
67+
<Rule Id="CA2237" Action="Warning" />
68+
<Rule Id="CA2238" Action="Warning" />
69+
<Rule Id="CA2240" Action="Warning" />
70+
<Rule Id="CA2241" Action="Warning" />
71+
<Rule Id="CA2242" Action="Warning" />
72+
</Rules>
73+
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.Features" RuleNamespace="Microsoft.CodeAnalysis.CSharp.Features">
74+
<Rule Id="IDE0003" Action="None" />
75+
</Rules>
76+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
77+
<Rule Id="SA1000" Action="Error" />
78+
<Rule Id="SA1001" Action="Error" />
79+
<Rule Id="SA1021" Action="Error" />
80+
<Rule Id="SA1022" Action="Error" />
81+
<Rule Id="SA1100" Action="Error" />
82+
<Rule Id="SA1101" Action="Error" />
83+
<Rule Id="SA1106" Action="Error" />
84+
<Rule Id="SA1111" Action="Error" />
85+
<Rule Id="SA1112" Action="Error" />
86+
<Rule Id="SA1119" Action="Error" />
87+
<Rule Id="SA1121" Action="Error" />
88+
<Rule Id="SA1122" Action="Error" />
89+
<Rule Id="SA1133" Action="Error" />
90+
<Rule Id="SA1300" Action="Error" />
91+
<Rule Id="SA1302" Action="Error" />
92+
<Rule Id="SA1303" Action="Error" />
93+
<Rule Id="SA1304" Action="Error" />
94+
<Rule Id="SA1305" Action="Warning" />
95+
<Rule Id="SA1309" Action="Error" />
96+
<Rule Id="SA1311" Action="Error" />
97+
<Rule Id="SA1400" Action="Error" />
98+
<Rule Id="SA1401" Action="Error" />
99+
<Rule Id="SA1402" Action="Error" />
100+
<Rule Id="SA1403" Action="Error" />
101+
<Rule Id="SA1404" Action="Error" />
102+
<Rule Id="SA1405" Action="Error" />
103+
<Rule Id="SA1406" Action="Error" />
104+
<Rule Id="SA1407" Action="Error" />
105+
<Rule Id="SA1408" Action="Error" />
106+
<Rule Id="SA1410" Action="Error" />
107+
<Rule Id="SA1411" Action="Error" />
108+
<Rule Id="SA1412" Action="Warning" />
109+
<Rule Id="SA1600" Action="None" />
110+
<Rule Id="SA1603" Action="Error" />
111+
<Rule Id="SA1609" Action="Warning" />
112+
<Rule Id="SA1633" Action="Error" />
113+
<Rule Id="SA1636" Action="Error" />
114+
<Rule Id="SA1642" Action="Error" />
115+
<Rule Id="SA1643" Action="Error" />
116+
</Rules>
117+
</RuleSet>

AsyncUsageAnalyzers/AsyncUsageAnalyzers/AsyncUsageAnalyzers.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<DefineConstants>DEBUG;TRACE</DefineConstants>
2323
<ErrorReport>prompt</ErrorReport>
2424
<WarningLevel>4</WarningLevel>
25-
<DocumentationFile>bin\Debug\AsyncUsageAnalyzers.xml</DocumentationFile>
2625
</PropertyGroup>
2726
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2827
<DebugType>pdbonly</DebugType>
@@ -31,7 +30,10 @@
3130
<DefineConstants>TRACE</DefineConstants>
3231
<ErrorReport>prompt</ErrorReport>
3332
<WarningLevel>4</WarningLevel>
34-
<DocumentationFile>bin\Release\AsyncUsageAnalyzers.xml</DocumentationFile>
33+
</PropertyGroup>
34+
<PropertyGroup>
35+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
36+
<CodeAnalysisRuleSet>..\AsyncUsageAnalyzers.ruleset</CodeAnalysisRuleSet>
3537
</PropertyGroup>
3638
<PropertyGroup>
3739
<SignAssembly>true</SignAssembly>
@@ -113,6 +115,11 @@
113115
</None>
114116
<None Include="packages.config" />
115117
</ItemGroup>
118+
<ItemGroup>
119+
<AdditionalFiles Include="..\stylecop.json">
120+
<Link>stylecop.json</Link>
121+
</AdditionalFiles>
122+
</ItemGroup>
116123
<ItemGroup>
117124
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
118125
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.dll</HintPath>

AsyncUsageAnalyzers/stylecop.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3+
"settings": {
4+
"documentationRules": {
5+
"companyName": "Tunnel Vision Laboratories, LLC",
6+
"copyrightText": "Copyright (c) {companyName}. All Rights Reserved.\r\nLicensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.",
7+
"xmlHeader": false,
8+
"fileNamingConvention": "metadata"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)