From 98e9a300bc81e485eb2afc95af93c28ad3a1cea9 Mon Sep 17 00:00:00 2001 From: Emma L Garland Date: Tue, 27 Aug 2024 17:56:09 +0100 Subject: [PATCH] Treat warnings as errors for initial projects (#15019) * Treat warnings as errors for Umbraco.Cms, Umbraco.Cms.Api.Common and Umbraco.Cms.Api.Delivery projects. * Treat warnings as errors for Umbraco.Cms.Imaging.ImageSharp and Umbraco.Cms.Imaging.ImageSharp2 projects * Treat warnings as errors for Umbraco.Cms.Persistence.EFCore.Sqlite, Umbraco.Cms.Persistence.EFCore.SqlServer and Umbraco.Cms.StaticAssets * Treat warnings as errors for Umbraco.Cms.Targets * Treat warnings as errors for templates/Umbraco.Templates and Umbraco.JsonSchema * More projects with warnings as errors. * Reverted warnings as errors due to some file changes since the update. * Remove unwanted tag * Removed warnings as errors on TestData project * Implement warnings as errors in props file, and exclude specific warnings where appropriate as per PR review suggestions. * Reverted spaces * Revert "Reverted spaces" This reverts commit 3734c45e2270c3324768b33e459aefcc6a8c4739. * Update sdk version to fully support Umbraco.code 2.2.0 dependency on Microsoft.CodeAnalysis.CSharp.Workspaces 4.10.0 * Ignore PathToLongErrors for now in static assets --------- Co-authored-by: Emma Garland Co-authored-by: Sven Geusens --- Directory.Build.props | 1 + global.json | 2 +- src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj | 1 - .../Umbraco.Cms.Api.Delivery.csproj | 5 ++++- .../Umbraco.Cms.Api.Management.csproj | 5 ++++- .../Umbraco.Cms.Imaging.ImageSharp.csproj | 1 - .../Umbraco.Cms.Imaging.ImageSharp2.csproj | 1 - .../Umbraco.Cms.Persistence.EFCore.SqlServer.csproj | 1 - .../Umbraco.Cms.Persistence.EFCore.Sqlite.csproj | 1 - .../Umbraco.Cms.Persistence.EFCore.csproj | 8 ++++++-- .../Umbraco.Cms.Persistence.SqlServer.csproj | 7 ++++++- .../Umbraco.Cms.Persistence.Sqlite.csproj | 5 ++++- .../Umbraco.Cms.StaticAssets.csproj | 7 ++++++- src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj | 6 +++++- src/Umbraco.Cms/Umbraco.Cms.csproj | 1 - src/Umbraco.Core/Umbraco.Core.csproj | 5 ++++- src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj | 5 ++++- src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj | 5 ++++- .../Umbraco.PublishedCache.NuCache.csproj | 5 ++++- src/Umbraco.Web.Common/Umbraco.Web.Common.csproj | 5 ++++- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++++ src/Umbraco.Web.Website/Umbraco.Web.Website.csproj | 5 ++++- tests/Umbraco.TestData/Umbraco.TestData.csproj | 5 +++++ .../Umbraco.Tests.Benchmarks.csproj | 5 ++++- tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj | 5 ++++- .../Umbraco.Tests.Integration.csproj | 5 ++++- .../Umbraco.Tests.UnitTests.csproj | 5 ++++- tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj | 5 ++++- 28 files changed, 90 insertions(+), 26 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 5f3055125f..81e3c40a9b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,6 +14,7 @@ en-US enable nullable + true enable true false diff --git a/global.json b/global.json index 391ba3c2a3..e972eb192a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.300", "rollForward": "latestFeature" } } diff --git a/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj b/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj index 523d6f4982..a73fc16574 100644 --- a/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj +++ b/src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj @@ -3,7 +3,6 @@ Umbraco CMS - API Common Contains the bits and pieces that are shared between the Umbraco CMS APIs. - diff --git a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj index 8948a49a1a..5e32b81eeb 100644 --- a/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj +++ b/src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj @@ -3,7 +3,10 @@ Umbraco CMS - Delivery API Contains the presentation layer for the Umbraco CMS Delivery API. - + + + ASP0019 + diff --git a/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj b/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj index 37ab3611de..88ee0cef62 100644 --- a/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj +++ b/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj @@ -7,7 +7,10 @@ Umbraco.Cms.Api.Management Umbraco.Cms.Api.Management - + + + false + diff --git a/src/Umbraco.Cms.Imaging.ImageSharp/Umbraco.Cms.Imaging.ImageSharp.csproj b/src/Umbraco.Cms.Imaging.ImageSharp/Umbraco.Cms.Imaging.ImageSharp.csproj index 549ea5cb40..77aed066d8 100644 --- a/src/Umbraco.Cms.Imaging.ImageSharp/Umbraco.Cms.Imaging.ImageSharp.csproj +++ b/src/Umbraco.Cms.Imaging.ImageSharp/Umbraco.Cms.Imaging.ImageSharp.csproj @@ -3,7 +3,6 @@ Umbraco CMS - Imaging - ImageSharp Adds imaging support using ImageSharp/ImageSharp.Web to Umbraco CMS. - diff --git a/src/Umbraco.Cms.Imaging.ImageSharp2/Umbraco.Cms.Imaging.ImageSharp2.csproj b/src/Umbraco.Cms.Imaging.ImageSharp2/Umbraco.Cms.Imaging.ImageSharp2.csproj index c513082675..16bac191d5 100644 --- a/src/Umbraco.Cms.Imaging.ImageSharp2/Umbraco.Cms.Imaging.ImageSharp2.csproj +++ b/src/Umbraco.Cms.Imaging.ImageSharp2/Umbraco.Cms.Imaging.ImageSharp2.csproj @@ -3,7 +3,6 @@ Umbraco CMS - Imaging - ImageSharp 2 Adds imaging support using ImageSharp/ImageSharp.Web version 2 to Umbraco CMS. - diff --git a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj index 7e6fc6153d..a43a5f01f2 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj +++ b/src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj @@ -3,7 +3,6 @@ Umbraco CMS - Persistence - Entity Framework Core - SQL Server migrations Adds support for Entity Framework Core SQL Server migrations to Umbraco CMS. - diff --git a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj index 36751bb869..f847ef4786 100644 --- a/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj +++ b/src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj @@ -3,7 +3,6 @@ Umbraco CMS - Persistence - Entity Framework Core - SQLite migrations Adds support for Entity Framework Core SQLite migrations to Umbraco CMS. - diff --git a/src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj b/src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj index 4500c2812b..d5fc7229b0 100644 --- a/src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj +++ b/src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj @@ -3,8 +3,12 @@ Umbraco CMS - Persistence - Entity Framework Core Adds support for Entity Framework Core to Umbraco CMS. - - + + + IDE0270,CS0108,CS1998 + + diff --git a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj index 75e2a6fe60..d62aea6ceb 100644 --- a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj +++ b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj @@ -3,7 +3,12 @@ Umbraco CMS - Persistence - SQL Server Adds support for SQL Server to Umbraco CMS. - + + + SA1405,SA1121,SA1117,SA1116,IDE1006,CS0618,IDE0270,IDE0057,IDE0054,CSO618,IDE0048,CS1574 + diff --git a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj index f9755aad61..0c39c66d64 100644 --- a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj +++ b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj @@ -3,7 +3,10 @@ Umbraco CMS - Persistence - SQLite Adds support for SQLite to Umbraco CMS. - + + + CS0114 + diff --git a/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj b/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj index ff487ca66a..80b7bc0211 100644 --- a/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj +++ b/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj @@ -6,6 +6,11 @@ / + + + NU5123 + + @@ -66,4 +71,4 @@ - + \ No newline at end of file diff --git a/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj b/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj index b83a582ade..e9e0df050d 100644 --- a/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj +++ b/src/Umbraco.Cms.Targets/Umbraco.Cms.Targets.csproj @@ -5,7 +5,11 @@ false false - + + + IDE0270,CS0108,CS1998 + diff --git a/src/Umbraco.Cms/Umbraco.Cms.csproj b/src/Umbraco.Cms/Umbraco.Cms.csproj index 39a3b03c56..3bc60ebd12 100644 --- a/src/Umbraco.Cms/Umbraco.Cms.csproj +++ b/src/Umbraco.Cms/Umbraco.Cms.csproj @@ -5,7 +5,6 @@ false false - diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index e0d0bd79fa..e4b3a7cd04 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -5,7 +5,10 @@ Contains the core assembly needed to run Umbraco CMS. Umbraco.Cms.Core - + + + false + diff --git a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj index 7e28eb6971..e036605449 100644 --- a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj +++ b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj @@ -5,7 +5,10 @@ Adds Examine searching support using Lucene to Umbraco CMS. Umbraco.Cms.Infrastructure.Examine - + + + CS0618 + diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj index a3b64b1cc5..cca5a43954 100644 --- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj +++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj @@ -5,7 +5,10 @@ Contains the infrastructure assembly needed to run Umbraco CMS. Umbraco.Cms.Infrastructure - + + + false + $(DefineConstants);TRACE_SCOPES diff --git a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj index 4894759e5f..04986712c8 100644 --- a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj +++ b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj @@ -5,7 +5,10 @@ Contains the published cache assembly needed to run Umbraco CMS. Umbraco.Cms.Infrastructure.PublishedCache - + + + false + diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index 4fa0721a68..6de2cd1278 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -5,7 +5,10 @@ Contains the web assembly needed to run Umbraco CMS. Umbraco.Cms.Web.Common - + + + false + diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index acd631e1ad..c22b5ae739 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -5,6 +5,10 @@ false + + + SA1119 + diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index 31c057e7b9..8ee1e80bb2 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -5,7 +5,10 @@ Contains the website assembly needed to run the frontend of Umbraco CMS. Umbraco.Cms.Web.Website - + + + false + diff --git a/tests/Umbraco.TestData/Umbraco.TestData.csproj b/tests/Umbraco.TestData/Umbraco.TestData.csproj index 7e19740a31..2b8fc3fca8 100644 --- a/tests/Umbraco.TestData/Umbraco.TestData.csproj +++ b/tests/Umbraco.TestData/Umbraco.TestData.csproj @@ -1,4 +1,9 @@ + + + CS0618,IDE1006,IDE0057 + diff --git a/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj b/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj index 189d69ac31..5b8f2b3b56 100644 --- a/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj +++ b/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj @@ -5,7 +5,10 @@ false false - + + + false + diff --git a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj index bf0dc9ddc1..24e0dce808 100644 --- a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj +++ b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj @@ -7,7 +7,10 @@ true $(BaseEnablePackageValidation) - + + + false + diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index b7ab21b062..a04ee45648 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -9,7 +9,10 @@ $(BaseEnablePackageValidation) NU5100 - + + + false + diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj index a411bad38c..6986e03494 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj @@ -5,7 +5,10 @@ false false - + + + false + diff --git a/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj b/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj index ce5001608f..471ebff802 100644 --- a/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj +++ b/tools/Umbraco.JsonSchema/Umbraco.JsonSchema.csproj @@ -4,7 +4,10 @@ false false - + + + false +