From e92a1b73f0ae4d1b7b30a51681be55fa9f3f28ca Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 28 Oct 2024 13:19:46 +0100 Subject: [PATCH] Formatting and disable warningsaserrors on tests --- .../V_15_0_0/ConvertBlockEditorPropertiesBase.cs | 15 ++++++++++----- .../BlockValuePropertyIndexValueFactoryBase.cs | 4 +--- tests/Directory.Build.props | 3 ++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/ConvertBlockEditorPropertiesBase.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/ConvertBlockEditorPropertiesBase.cs index a2a59f911a..0f1fd3070a 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/ConvertBlockEditorPropertiesBase.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/ConvertBlockEditorPropertiesBase.cs @@ -84,16 +84,19 @@ public abstract class ConvertBlockEditorPropertiesBase : MigrationBase continue; } - _logger.LogInformation("Migration starting for all properties of type: {propertyEditorAlias}", + _logger.LogInformation( + "Migration starting for all properties of type: {propertyEditorAlias}", propertyEditorAlias); if (Handle(propertyTypes, languagesById)) { - _logger.LogInformation("Migration succeeded for all properties of type: {propertyEditorAlias}", + _logger.LogInformation( + "Migration succeeded for all properties of type: {propertyEditorAlias}", propertyEditorAlias); } else { - _logger.LogError("Migration failed for one or more properties of type: {propertyEditorAlias}", + _logger.LogError( + "Migration failed for one or more properties of type: {propertyEditorAlias}", propertyEditorAlias); } } @@ -154,7 +157,8 @@ public abstract class ConvertBlockEditorPropertiesBase : MigrationBase Task task; using (ExecutionContext.SuppressFlow()) { - task = Task.Run(() => + task = Task.Run( + () => { using ICoreScope scope = _coreScopeProvider.CreateCoreScope(); scope.Complete(); @@ -173,7 +177,8 @@ public abstract class ConvertBlockEditorPropertiesBase : MigrationBase // NOTE: some old property data DTOs can have variance defined, even if the property type no longer varies var culture = propertyType.VariesByCulture() && propertyDataDto.LanguageId.HasValue - && languagesById.TryGetValue(propertyDataDto.LanguageId.Value, + && languagesById.TryGetValue( + propertyDataDto.LanguageId.Value, out ILanguage? language) ? language.IsoCode : null; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyIndexValueFactoryBase.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyIndexValueFactoryBase.cs index 1cfcf48533..f17e9997ac 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyIndexValueFactoryBase.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyIndexValueFactoryBase.cs @@ -136,9 +136,7 @@ internal abstract class BlockValuePropertyIndexValueFactoryBase : J indexData.Add( ToRawData( blockItemData.ContentTypeKey, - blockItemData.Values.Where(value => value.Culture is null || exposedCultures.Contains(value.Culture)) - ) - ); + blockItemData.Values.Where(value => value.Culture is null || exposedCultures.Contains(value.Culture)))); } return indexData; diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 49f18af1bd..3d8b1f9bdd 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -8,8 +8,9 @@ false $(EnablePackageValidation) false + false - + annotations