From 8a036140db90d9115d5b120e08e85d63d3475076 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 19 Apr 2024 17:29:47 -0700 Subject: [PATCH] Add AvsEnableDevWarningsNotAsErrors prop (#15106) * Add AvsEnableDevWarningsNotAsErrors prop * Begone StyleCop --- .editorconfig | 6 +- Avalonia.sln | 1 + Directory.Build.props | 1 + Settings.StyleCop | 184 --------------------------------------- build/WarnAsErrors.props | 21 +++++ 5 files changed, 26 insertions(+), 187 deletions(-) delete mode 100644 Settings.StyleCop create mode 100644 build/WarnAsErrors.props diff --git a/.editorconfig b/.editorconfig index ee24c310c0..42c6f62e9c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/Avalonia.sln b/Avalonia.sln index 8d40171b28..88a43802a8 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -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}" diff --git a/Directory.Build.props b/Directory.Build.props index fa0f14880e..117c0964d2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,7 @@ + $(MSBuildThisFileDirectory)build-intermediate/nuget $(MSBuildThisFileDirectory)\src\tools\Avalonia.Designer.HostApp\bin\$(Configuration)\netstandard2.0\Avalonia.Designer.HostApp.dll diff --git a/Settings.StyleCop b/Settings.StyleCop deleted file mode 100644 index 5bd6cda777..0000000000 --- a/Settings.StyleCop +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/build/WarnAsErrors.props b/build/WarnAsErrors.props new file mode 100644 index 0000000000..dd105f206e --- /dev/null +++ b/build/WarnAsErrors.props @@ -0,0 +1,21 @@ + + + + + $(WarningsNotAsErrors);CS0649 + + $(WarningsNotAsErrors);CS0162 + + $(WarningsNotAsErrors);CA2211 + + $(WarningsNotAsErrors);CA1821 + + $(WarningsNotAsErrors);CA1823 + + $(WarningsNotAsErrors);AVLN2203 + + $(WarningsNotAsErrors);AVLN2205 + + $(WarningsNotAsErrors);AVLN2207 + +