Skip to content

Commit

Permalink
Disable (Unit Test suggestion) analyzers in release mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jan 21, 2024
1 parent 355999a commit 2d053d4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PolySharp" Version="1.*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="PolySharp" Version="1.*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="AsyncFixer" Version="*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="DotNetProjectFile.Analyzers" Version="*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="AsyncFixer" Version="*" PrivateAssets="all" />
<PackageReference Include="DotNetProjectFile.Analyzers" Version="*" Condition="'$(TargetFramework)'=='net8.0'" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Additional files">
Expand Down
2 changes: 2 additions & 0 deletions specs/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[*]
dotnet_diagnostic.CA1861.severity = none # Prefer 'static readonly' fields over constant array arguments

dotnet_diagnostic.S1133.severity = none # Deprecated code should be removed
dotnet_diagnostic.S3900.severity = none # Arguments of public methods should be validated against null

dotnet_diagnostic.SYSLIB1045.severity = none # Convert to 'GeneratedRegexAttribute'.

3 changes: 3 additions & 0 deletions specs/Qowaiv.Benchmarks/Properties/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
global using Qowaiv.Financial;
global using Qowaiv.Globalization;
global using Qowaiv.Text;
global using System;
global using System.Collections;
global using System.Collections.Generic;
global using System.Diagnostics.CodeAnalysis;
global using System.Diagnostics.Contracts;
global using System.Globalization;
global using System.Linq;
global using System.Text;
global using System.Text.RegularExpressions;
12 changes: 9 additions & 3 deletions specs/Qowaiv.Benchmarks/Qowaiv.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\props\nopackage.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Benchmarks</RootNamespace>
</PropertyGroup>

Expand All @@ -21,9 +22,14 @@
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
</ItemGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="FluentAssertions.Analyzers" Version="*" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Qowaiv.TestTools\Qowaiv.TestTools.csproj" />
<ProjectReference Include="..\..\src\Qowaiv\Qowaiv.csproj" />
<ProjectReference Include="..\..\src\Qowaiv.TestTools\Qowaiv.TestTools.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion specs/Qowaiv.Specs/Qowaiv.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<PackageReference Include="NUnit3TestAdapter" Version="*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Analyzers">
<!-- We do not want to report on this during a PR/Release build. -->
<ItemGroup Label="Analyzers" Condition="'$(Configuration)'=='DEBUG'">
<PackageReference Include="FluentAssertions.Analyzers" Version="*" PrivateAssets="all" />
<PackageReference Include="NUnit.Analyzers" Version="*" PrivateAssets="all" />
</ItemGroup>
Expand Down

0 comments on commit 2d053d4

Please sign in to comment.