Skip to content

Commit 8d13e51

Browse files
authored
Merge pull request #2460 from sharwell/warn-as-error
Enable warnings as errors on AppVeyor
2 parents 002898b + 18091c0 commit 8d13e51

12 files changed

Lines changed: 45 additions & 54 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/StyleCop.Analyzers.CodeFixes.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
3535
</PropertyGroup>
36+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
37+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
38+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
39+
</PropertyGroup>
3640
<PropertyGroup>
3741
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
3842
<CodeAnalysisRuleSet>..\StyleCop.Analyzers.ruleset</CodeAnalysisRuleSet>
@@ -218,8 +222,9 @@
218222
</ItemGroup>
219223
<ItemGroup>
220224
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
221-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
222-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
225+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Analyzer.Utilities.dll" />
226+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
227+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
223228
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
224229
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
225230
</ItemGroup>

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="portable45-net45+win8" developmentDependency="true" />
4-
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="portable45-net45+win8" />
4+
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.2.0-beta2" targetFramework="portable45-net45+win8" />
55
<package id="Microsoft.CodeAnalysis.Common" version="1.2.1" targetFramework="portable45-net45+win8" />
66
<package id="Microsoft.CodeAnalysis.CSharp" version="1.2.1" targetFramework="portable45-net45+win8" />
77
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.2.1" targetFramework="portable45-net45+win8" />

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/StyleCop.Analyzers.Test.CSharp7.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<WarningLevel>4</WarningLevel>
3636
<Prefer32Bit>false</Prefer32Bit>
3737
</PropertyGroup>
38+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
39+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
40+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
41+
</PropertyGroup>
3842
<PropertyGroup>
3943
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
4044
<CodeAnalysisRuleSet>..\StyleCop.Analyzers.Internal.ruleset</CodeAnalysisRuleSet>
@@ -461,8 +465,9 @@
461465
</ItemGroup>
462466
<ItemGroup>
463467
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
464-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
465-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
468+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Analyzer.Utilities.dll" />
469+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
470+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
466471
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
467472
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
468473
</ItemGroup>

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="net452" developmentDependency="true" />
44
<package id="ManagedEsent" version="1.9.4" targetFramework="net46" />
5-
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net452" />
5+
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.2.0-beta2" targetFramework="net46" />
66
<package id="Microsoft.CodeAnalysis.Common" version="2.1.0" targetFramework="net46" />
77
<package id="Microsoft.CodeAnalysis.CSharp" version="2.1.0" targetFramework="net46" />
88
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="2.1.0" targetFramework="net46" />

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<WarningLevel>4</WarningLevel>
3636
<Prefer32Bit>false</Prefer32Bit>
3737
</PropertyGroup>
38+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
39+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
40+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
41+
</PropertyGroup>
3842
<PropertyGroup>
3943
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
4044
<CodeAnalysisRuleSet>..\StyleCop.Analyzers.Internal.ruleset</CodeAnalysisRuleSet>
@@ -455,8 +459,9 @@
455459
</ItemGroup>
456460
<ItemGroup>
457461
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
458-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
459-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
462+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Analyzer.Utilities.dll" />
463+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
464+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
460465
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
461466
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
462467
</ItemGroup>

StyleCop.Analyzers/StyleCop.Analyzers.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="net452" developmentDependency="true" />
4-
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net452" />
4+
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.2.0-beta2" targetFramework="net452" />
55
<package id="Microsoft.CodeAnalysis.Common" version="1.2.1" targetFramework="net452" />
66
<package id="Microsoft.CodeAnalysis.CSharp" version="1.2.1" targetFramework="net452" />
77
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.2.1" targetFramework="net452" />

StyleCop.Analyzers/StyleCop.Analyzers.Vsix/StyleCop.Analyzers.Vsix.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
<ErrorReport>prompt</ErrorReport>
4646
<WarningLevel>4</WarningLevel>
4747
</PropertyGroup>
48+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
49+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
50+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
51+
</PropertyGroup>
4852
<PropertyGroup>
4953
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
5054
<CodeAnalysisRuleSet>..\StyleCop.Analyzers.Internal.ruleset</CodeAnalysisRuleSet>

StyleCop.Analyzers/StyleCop.Analyzers.ruleset

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RuleSet Name="Rules for StyleCop.Analyzers" Description="Code analysis rules for StyleCop.Analyzers.csproj." ToolsVersion="14.0">
33
<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" />
4+
<Rule Id="UseConfigureAwait" Action="Warning" />
85
</Rules>
96
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
107
<Rule Id="CA1001" Action="Warning" />
@@ -74,44 +71,9 @@
7471
<Rule Id="IDE0003" Action="None" />
7572
</Rules>
7673
<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" />
9474
<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" />
10875
<Rule Id="SA1412" Action="Warning" />
10976
<Rule Id="SA1600" Action="None" />
110-
<Rule Id="SA1603" Action="Error" />
11177
<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" />
11678
</Rules>
11779
</RuleSet>

StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
3535
</PropertyGroup>
36+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
37+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
38+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
39+
</PropertyGroup>
3640
<PropertyGroup>
3741
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
3842
<CodeAnalysisRuleSet>..\StyleCop.Analyzers.ruleset</CodeAnalysisRuleSet>
@@ -440,8 +444,9 @@
440444
</ItemGroup>
441445
<ItemGroup>
442446
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
443-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
444-
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
447+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Analyzer.Utilities.dll" />
448+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
449+
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.2.0-beta2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
445450
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
446451
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.1.0-beta003\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
447452
</ItemGroup>

StyleCop.Analyzers/StyleCop.Analyzers/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="portable45-net45+win8" developmentDependency="true" />
4-
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="portable45-net45+win8" />
4+
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.2.0-beta2" targetFramework="portable45-net45+win8" />
55
<package id="Microsoft.CodeAnalysis.Common" version="1.2.1" targetFramework="portable45-net45+win8" />
66
<package id="Microsoft.CodeAnalysis.CSharp" version="1.2.1" targetFramework="portable45-net45+win8" />
77
<package id="Microsoft.Composition" version="1.0.27" targetFramework="portable-net45+win8" />

0 commit comments

Comments
 (0)