Skip to content

Commit

Permalink
Add AvsEnableDevWarningsNotAsErrors prop (AvaloniaUI#15106)
Browse files Browse the repository at this point in the history
* Add AvsEnableDevWarningsNotAsErrors prop

* Begone StyleCop
  • Loading branch information
maxkatz6 authored Apr 20, 2024
1 parent 8a65cb6 commit 8a03614
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 187 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ dotnet_diagnostic.CA1815.severity = warning
# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = warning
# CA1821: Remove empty finalizers
dotnet_diagnostic.CA1821.severity = warning
dotnet_diagnostic.CA1821.severity = error
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = suggestion
# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = warning
dotnet_code_quality.CA1822.api_surface = private, internal
# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = error
# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = warning
# CA1826: Use property instead of Linq Enumerable method
Expand Down
1 change: 1 addition & 0 deletions Avalonia.sln
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Props", "Props", "{F3AC8BC1
build\UnitTests.NetFX.props = build\UnitTests.NetFX.props
build\XUnit.props = build\XUnit.props
build\TargetFrameworks.props = build\TargetFrameworks.props
build\WarnAsErrors.props = build\WarnAsErrors.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{4D6FAF79-58B4-482F-9122-0668C346364C}"
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)/build/AvaloniaPublicKey.props"/>
<Import Project="$(MSBuildThisFileDirectory)/build/TargetFrameworks.props"/>
<Import Project="$(MSBuildThisFileDirectory)/build/WarnAsErrors.props" />
<PropertyGroup>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(MSBuildThisFileDirectory)build-intermediate/nuget</PackageOutputPath>
<AvaloniaPreviewerNetCoreToolPath>$(MSBuildThisFileDirectory)\src\tools\Avalonia.Designer.HostApp\bin\$(Configuration)\netstandard2.0\Avalonia.Designer.HostApp.dll</AvaloniaPreviewerNetCoreToolPath>
Expand Down
184 changes: 0 additions & 184 deletions Settings.StyleCop

This file was deleted.

21 changes: 21 additions & 0 deletions build/WarnAsErrors.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Keep in sync with .editorconfig -->
<PropertyGroup Condition="'$(AvsEnableDevWarningsNotAsErrors)' == 'true'">
<!-- CS0649: Field 'field' is never assigned to, and will always have its default value 'value' -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS0649</WarningsNotAsErrors>
<!-- CS0162: Remove unreachable code -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS0162</WarningsNotAsErrors>
<!-- CA2211:Non-constant fields should not be visible -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA2211</WarningsNotAsErrors>
<!-- CA1821: Remove empty finalizers -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1821</WarningsNotAsErrors>
<!-- CA1823: Avoid unused private fields -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1823</WarningsNotAsErrors>
<!-- AVLN2203: DuplicateSetterError -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);AVLN2203</WarningsNotAsErrors>
<!-- AVLN2205: RequiredTemplatePartMissing -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);AVLN2205</WarningsNotAsErrors>
<!-- AVLN2207: TemplatePartWrongType -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);AVLN2207</WarningsNotAsErrors>
</PropertyGroup>
</Project>

0 comments on commit 8a03614

Please sign in to comment.