Skip to content

Commit 26d68f4

Browse files
authored
Add FxCop analyzers (#354)
This adds the new FxCop analyzers that are supported in 15.5. This change adds the analyzers but disables all failing rules, which can be enabled in future PRs.
1 parent 76e3fd9 commit 26d68f4

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

Directory.Build.targets

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
88
<PrivateAssets>All</PrivateAssets>
99
</PackageReference>
10-
10+
11+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.0-beta2">
12+
<PrivateAssets>All</PrivateAssets>
13+
</PackageReference>
14+
1115
<!-- GitVersionTask is not compiled against .NET Core, so importing the targets will
1216
result in a failure because it will try to resolve Microsoft.Build.Utilities v4.0 -->
1317
<PackageReference Include="GitVersionTask" Version="4.0.0-beta0012" Condition=" '$(MSBuildRuntimeType)' != 'Core' ">
@@ -17,5 +21,5 @@
1721
</ItemGroup>
1822

1923
<Import Project="$(MSBuildThisFileDirectory)\Tests.targets" />
20-
24+
2125
</Project>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ Build Instructions
143143

144144
This project uses the new csproj format and the release versions of the tooling in Visual Studio 2017. For more information on how to use this project type to build your project, see the release notes for Visual Studio 2017: https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes#dotnetcore. Other editors that support the latest .NET project files include VS Code, VS for Mac, or .NET CLI. See https://www.microsoft.com/net/download/core for details.
145145

146+
The project will often require the latest release of the C# compiler as many new features come on-line that greatly aid in ease of development. As of now, the C# 7.2 compiler is required (which was released in December 2017) and comes standard in Visual Studio 2017 Update 5, with other IDEs providing updates to the compiler as well.
147+
146148
To build the Open XML SDK:
147149
- Clone the repo at https://github.com/OfficeDev/Open-XML-SDK
148150
- Open the solution with an editor that supports the latest .NET project files

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ after_build:
2121
- ps: .\build\SignPackage.ps1
2222

2323
test_script:
24-
- cmd: msbuild /t:test .\Open-Xml-SDK.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
24+
- cmd: msbuild /m /t:test .\Open-Xml-SDK.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
2525

2626
deploy:
2727
provider: NuGet

rules.ruleset

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,31 @@
193193
<Rule Id="SA1651" Action="None" />
194194
<Rule Id="SA1652" Action="None" />
195195
</Rules>
196+
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
197+
<Rule Id="CA1000" Action="None" />
198+
<Rule Id="CA1018" Action="None" />
199+
<Rule Id="CA1040" Action="None" />
200+
<Rule Id="CA1052" Action="None" />
201+
<Rule Id="CA1054" Action="None" />
202+
<Rule Id="CA1056" Action="None" />
203+
<Rule Id="CA1065" Action="None" />
204+
<Rule Id="CA1304" Action="None" />
205+
<Rule Id="CA1305" Action="None" />
206+
<Rule Id="CA1307" Action="None" />
207+
<Rule Id="CA1507" Action="None" />
208+
<Rule Id="CA1707" Action="None" />
209+
<Rule Id="CA1710" Action="None" />
210+
<Rule Id="CA1721" Action="None" />
211+
<Rule Id="CA1724" Action="None" />
212+
<Rule Id="CA1801" Action="None" />
213+
<Rule Id="CA1802" Action="None" />
214+
<Rule Id="CA1816" Action="None" />
215+
<Rule Id="CA1823" Action="None" />
216+
<Rule Id="CA1825" Action="None" />
217+
<Rule Id="CA2208" Action="None" />
218+
<Rule Id="CA2222" Action="None" />
219+
<Rule Id="CA2225" Action="None" />
220+
<Rule Id="CA2235" Action="None" />
221+
<Rule Id="CA3075" Action="None" />
222+
</Rules>
196223
</RuleSet>

0 commit comments

Comments
 (0)