Skip to content

Commit

Permalink
Enable code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKotsenas committed May 31, 2024
1 parent 8b96179 commit 1876610
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
8 changes: 0 additions & 8 deletions Source/Moq.Analyzers/Moq.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,12 @@
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
Expand Down
12 changes: 12 additions & 0 deletions Source/stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"layoutRules": {
"newlineAtEndOfFile": "require"
},
"orderingRules": {
"systemUsingDirectivesFirst": true,
"usingDirectivesPlacement": "outsideNamespace"
}
}
}
12 changes: 11 additions & 1 deletion build/targets/compiler/Compiler.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<Project>
<PropertyGroup>
<PropertyGroup Label="Language options">
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Label="Code analysis">
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisMode>All</AnalysisMode>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(RepoRoot)/Source/stylecop.json" />
</ItemGroup>
</Project>

0 comments on commit 1876610

Please sign in to comment.