Skip to content

Commit 9cfae82

Browse files
committed
Add code-analysis and stylecop rules
1 parent 43c4a1e commit 9cfae82

30 files changed

+1263
-49
lines changed

Atc.AutoFormatter.sln

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atc.AutoFormatter", "src\At
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atc.Formatter.Tests", "test\Atc.Formatter.Tests\Atc.Formatter.Tests.csproj", "{F81C1017-96C3-4682-8BAF-2FAEA72B5983}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66F0DA10-74F6-4343-9815-42D7D7CE8B37}"
11+
ProjectSection(SolutionItems) = preProject
12+
build\code-analysis-test.ruleset = build\code-analysis-test.ruleset
13+
build\code-analysis.ruleset = build\code-analysis.ruleset
14+
build\stylecop.json = build\stylecop.json
15+
EndProjectSection
16+
EndProject
1017
Global
1118
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1219
Debug|Any CPU = Debug|Any CPU

build/code-analysis-test.ruleset

+499
Large diffs are not rendered by default.

build/code-analysis.props

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup Label="Code Analysis">
5+
<Features>IOperation</Features>
6+
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors>
7+
<WarningsAsErrors />
8+
<nullable Condition="'$(IsTestFolder)' == 'false'">enable</nullable>
9+
10+
<CodeAnalysisRuleSet Condition="'$(IsTestFolder)' == 'false'">$(MSBuildThisFileDirectory)code-analysis.ruleset</CodeAnalysisRuleSet>
11+
<CodeAnalysisRuleSet Condition="'$(IsTestFolder)' == 'true'">$(MSBuildThisFileDirectory)code-analysis-test.ruleset</CodeAnalysisRuleSet>
12+
</PropertyGroup>
13+
14+
<ItemGroup Label="Code Analysis">
15+
<CodeAnalysisDictionary Include="$(MSBuildThisFileDirectory)custom-dictionary.xml" Link="custom-dictionary.xml" />
16+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" Visible="false" />
17+
</ItemGroup>
18+
19+
<ItemGroup Label="NuGet">
20+
<PackageReference Include="AsyncFixer" Version="1.3.0" PrivateAssets="All" />
21+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
22+
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.13" Condition="'$(IsTestFolder)' == 'true'" PrivateAssets="All" />
23+
<PackageReference Include="SecurityCodeScan" Version="3.5.3" PrivateAssets="all" />
24+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.14.0.22654" Condition="'$(IsTestFolder)' != 'true'" PrivateAssets="All" />
25+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
26+
</ItemGroup>
27+
</Project>

0 commit comments

Comments
 (0)