Skip to content

Commit

Permalink
✨ Test tweaks and more properties (#15)
Browse files Browse the repository at this point in the history
Tweaks docuemntation rules for test projects. Adds common properties to
this package even if not _strictly_ analyzer related. These do represent
my default settings.
  • Loading branch information
connorjs authored Jul 28, 2024
1 parent e3e6860 commit 9e35889
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions connorjs-analyzers/build/connorjs-analyzers.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
</ItemGroup>

<!-- MSBuild properties (for .NET) -->
<!-- https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props -->
<PropertyGroup>
<!-- MSBuild properties (for .NET) -->
<!-- https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props -->

<!-- Build related -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!-- Code analysis -->
<AnalysisMode>Recommended</AnalysisMode>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers> <!-- Defaults to true in .NET 5+ -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<!-- C# compiler options -->
<!-- https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/ -->
<PropertyGroup>
<!-- Reference -->
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences> <!-- Prefer explicit dependencies -->

<!-- Code generation -->
<ImplicitUsings>disable</ImplicitUsings> <!-- Prefer explicit usings -->

<!-- C# compiler options -->
<!-- https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/ -->

<!-- Language -->
<Nullable>enable</Nullable>

<!-- Errors and warnings -->
<!--
1. Default all warns to errors (`TreatWarningsAsErrors`).
Expand All @@ -29,5 +41,19 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors />
<NoWarn />

<!-- Code generation -->
<Deterministic>true</Deterministic>
</PropertyGroup>

<!-- Overrides for test projects -->
<PropertyGroup Condition="$(IsTestProject)">
<!-- Test projects do not generate documentation -->
<GenerateDocumentationFile>false</GenerateDocumentationFile>

<!-- Disable these for test projects
- SA0001, SA1600: Documentation-related
-->
<NoWarn>SA0001,SA1600,$(NoWarn)</NoWarn>
</PropertyGroup>
</Project>

0 comments on commit 9e35889

Please sign in to comment.