Skip to content

Commit 98e9a30

Browse files
emmagarlandemmagarlandrskMigaroez
authored
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 3734c45. * 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 <[email protected]> Co-authored-by: Sven Geusens <[email protected]>
1 parent 148d51b commit 98e9a30

File tree

28 files changed

+90
-26
lines changed

28 files changed

+90
-26
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<NeutralLanguage>en-US</NeutralLanguage>
1515
<Nullable>enable</Nullable>
1616
<WarningsAsErrors>nullable</WarningsAsErrors>
17+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1718
<ImplicitUsings>enable</ImplicitUsings>
1819
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1920
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "8.0.300",
44
"rollForward": "latestFeature"
55
}
66
}

src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Title>Umbraco CMS - API Common</Title>
44
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<FrameworkReference Include="Microsoft.AspNetCore.App" />
98
</ItemGroup>

src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<Title>Umbraco CMS - Delivery API</Title>
44
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
55
</PropertyGroup>
6-
6+
<PropertyGroup>
7+
<!-- TODO: [ASP0019] use IHeaderDictionary.Append or the indexer to append or set headers and remove this override -->
8+
<WarningsNotAsErrors>ASP0019</WarningsNotAsErrors>
9+
</PropertyGroup>
710
<ItemGroup>
811
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
912
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />

src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<AssemblyName>Umbraco.Cms.Api.Management</AssemblyName>
88
<RootNamespace>Umbraco.Cms.Api.Management</RootNamespace>
99
</PropertyGroup>
10-
10+
<PropertyGroup>
11+
<!-- TODO: Fix all warnings and remove this override -->
12+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
13+
</PropertyGroup>
1114
<ItemGroup>
1215
<PackageReference Include="JsonPatch.Net" />
1316
<PackageReference Include="Swashbuckle.AspNetCore" />

src/Umbraco.Cms.Imaging.ImageSharp/Umbraco.Cms.Imaging.ImageSharp.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Title>Umbraco CMS - Imaging - ImageSharp</Title>
44
<Description>Adds imaging support using ImageSharp/ImageSharp.Web to Umbraco CMS.</Description>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<PackageReference Include="SixLabors.ImageSharp" />
98
<PackageReference Include="SixLabors.ImageSharp.Web" />

src/Umbraco.Cms.Imaging.ImageSharp2/Umbraco.Cms.Imaging.ImageSharp2.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Title>Umbraco CMS - Imaging - ImageSharp 2</Title>
44
<Description>Adds imaging support using ImageSharp/ImageSharp.Web version 2 to Umbraco CMS.</Description>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<PackageReference Include="SixLabors.ImageSharp" VersionOverride="[2.1.9, 3)" />
98
<PackageReference Include="SixLabors.ImageSharp.Web" VersionOverride="[2.0.2, 3)" />

src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQL Server migrations</Title>
44
<Description>Adds support for Entity Framework Core SQL Server migrations to Umbraco CMS.</Description>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
98
<PackageReference Include="Azure.Identity" />

src/Umbraco.Cms.Persistence.EFCore.Sqlite/Umbraco.Cms.Persistence.EFCore.Sqlite.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQLite migrations</Title>
44
<Description>Adds support for Entity Framework Core SQLite migrations to Umbraco CMS.</Description>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
98
</ItemGroup>

src/Umbraco.Cms.Persistence.EFCore/Umbraco.Cms.Persistence.EFCore.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
<Title>Umbraco CMS - Persistence - Entity Framework Core</Title>
44
<Description>Adds support for Entity Framework Core to Umbraco CMS.</Description>
55
</PropertyGroup>
6-
7-
<ItemGroup>
6+
<PropertyGroup>
7+
<!-- TODO: [IDE0270] Simplify null checks, [CS0108] resolve hiding inherited members, [CS1998] remove async or make method synchronous,
8+
and remove this override -->
9+
<WarningsNotAsErrors>IDE0270,CS0108,CS1998</WarningsNotAsErrors>
10+
</PropertyGroup>
11+
<ItemGroup>
812
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
913
<PackageReference Include="Azure.Identity" />
1014
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />

0 commit comments

Comments
 (0)