Formatting and disable warningsaserrors on tests

This commit is contained in:
Bjarke Berg
2024-10-28 13:19:46 +01:00
parent aceadc1ed7
commit e92a1b73f0
3 changed files with 13 additions and 9 deletions

View File

@@ -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;

View File

@@ -136,9 +136,7 @@ internal abstract class BlockValuePropertyIndexValueFactoryBase<TSerialized> : 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;

View File

@@ -8,8 +8,9 @@
<IsPackable>false</IsPackable>
<BaseEnablePackageValidation>$(EnablePackageValidation)</BaseEnablePackageValidation>
<EnablePackageValidation>false</EnablePackageValidation>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<!-- TODO: Update test projects to use nullable reference types and remove this to enable nullable warnings as errors (the solution default) -->
<Nullable>annotations</Nullable>