From c17e5b830ba1c97785f25eb83fc316a8ce439fb4 Mon Sep 17 00:00:00 2001 From: sveinungf Date: Fri, 4 Oct 2024 19:09:04 +0200 Subject: [PATCH 1/5] Update packages --- Directory.Packages.props | 20 ++-- ...Style_ClassWithEmptyCellStyle.verified.txt | 15 ++- ...ConverterAndCellValueTruncate.verified.txt | 15 ++- ...sNotInheritCellValueConverter.verified.txt | 15 ++- ...ter_ClassWithInvalidConverter.verified.txt | 15 ++- ...lidConverterOnComplexProperty.verified.txt | 31 ++++-- ...thoutParameterlessConstructor.verified.txt | 15 ++- ...ellValueTruncateOnInvalidType.verified.txt | 15 ++- ...alueTruncateWithInvalidLength.verified.txt | 15 ++- ...thColumnWidthWithInvalidWidth.verified.txt | 15 ++- ...ssWithDuplicateColumnOrdering.verified.txt | 15 ++- ...lumnOrderingAcrossInheritance.verified.txt | 15 ++- ...ropertyReferenceColumnHeaders.verified.txt | 105 +++++++++++------- ...enerate_ClassWithNoProperties.verified.txt | 16 ++- ..._ClassWithUnsupportedProperty.verified.txt | 16 ++- ...sWhenTheFirstTypeEmitsWarning.verified.txt | 16 ++- SpreadCheetah.Test/SpreadCheetah.Test.csproj | 1 - 17 files changed, 212 insertions(+), 143 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 739839ee..cf5c1dec 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,26 +5,26 @@ - + - + - - + + - + - + @@ -33,10 +33,10 @@ - - - - + + + + \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt index 0059bfc0..164f58f3 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1006, - Title: Invalid attribute argument, - Severity: Error, - WarningLevel: 0, Location: : (6,5)-(6,18), - MessageFormat: '{0}' is an invalid argument for {1}, Message: '' is an invalid argument for CellStyleAttribute, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1006, + Title: Invalid attribute argument, + MessageFormat: '{0}' is an invalid argument for {1}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt index 5e0db993..f10419a6 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1008, - Title: Attribute combination not supported, - Severity: Error, - WarningLevel: 0, Location: : (7,19)-(7,27), - MessageFormat: Having both the {0} and the {1} attributes on a property is not supported, Message: Having both the CellValueConverter and the CellValueTruncate attributes on a property is not supported, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1008, + Title: Attribute combination not supported, + MessageFormat: Having both the {0} and the {1} attributes on a property is not supported, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt index 7756c10c..82c21879 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1007, - Title: Invalid attribute type argument, - Severity: Error, - WarningLevel: 0, Location: : (5,5)-(5,54), - MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1007, + Title: Invalid attribute type argument, + MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt index b8648df4..20ec0df3 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1007, - Title: Invalid attribute type argument, - Severity: Error, - WarningLevel: 0, Location: : (5,5)-(5,54), - MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1007, + Title: Invalid attribute type argument, + MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt index ef20103e..b01ad937 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt @@ -1,24 +1,31 @@ { Diagnostics: [ { - Id: SPCH1007, - Title: Invalid attribute type argument, - Severity: Error, - WarningLevel: 0, Location: : (5,5)-(5,48), - MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, Message: Type 'MyNamespace.StringConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1007, + Title: Invalid attribute type argument, + MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1002, - Title: Unsupported type for cell value, - Severity: Warning, - WarningLevel: 1, Location: : (16,1)-(16,65), - MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., Message: The type 'ClassWithInvalidConverterOnComplexProperty' has a property of type 'Object' which is not supported as a cell value. The property will be ignored when creating the row., - Category: SpreadCheetah.SourceGenerator + Severity: Warning, + WarningLevel: 1, + Descriptor: { + Id: SPCH1002, + Title: Unsupported type for cell value, + MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithoutParameterlessConstructor.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithoutParameterlessConstructor.verified.txt index 299c0328..b9e5fce9 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithoutParameterlessConstructor.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithoutParameterlessConstructor.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1009, - Title: Type must have a public parameterless constructor, - Severity: Error, - WarningLevel: 0, Location: : (5,5)-(5,52), - MessageFormat: Type '{0}' must have a public parameterless constructor, Message: Type 'MyNamespace.FixedValueConverter' must have a public parameterless constructor, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1009, + Title: Type must have a public parameterless constructor, + MessageFormat: Type '{0}' must have a public parameterless constructor, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateOnInvalidType.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateOnInvalidType.verified.txt index 5cb56996..29eda5b5 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateOnInvalidType.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateOnInvalidType.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1005, - Title: Unsupported type for attribute, - Severity: Error, - WarningLevel: 0, Location: : (6,5)-(6,26), - MessageFormat: {0} is not supported on properties of type '{1}', Message: CellValueTruncateAttribute is not supported on properties of type 'int', - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1005, + Title: Unsupported type for attribute, + MessageFormat: {0} is not supported on properties of type '{1}', + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateWithInvalidLength.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateWithInvalidLength.verified.txt index c7952cc5..79c03f87 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateWithInvalidLength.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithCellValueTruncateWithInvalidLength.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1006, - Title: Invalid attribute argument, - Severity: Error, - WarningLevel: 0, Location: : (6,5)-(6,25), - MessageFormat: '{0}' is an invalid argument for {1}, Message: '0' is an invalid argument for CellValueTruncateAttribute, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1006, + Title: Invalid attribute argument, + MessageFormat: '{0}' is an invalid argument for {1}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithColumnWidthWithInvalidWidth.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithColumnWidthWithInvalidWidth.verified.txt index 497de010..fdc15082 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithColumnWidthWithInvalidWidth.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithColumnWidthWithInvalidWidth.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1006, - Title: Invalid attribute argument, - Severity: Error, - WarningLevel: 0, Location: : (6,5)-(6,21), - MessageFormat: '{0}' is an invalid argument for {1}, Message: '300' is an invalid argument for ColumnWidthAttribute, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1006, + Title: Invalid attribute argument, + MessageFormat: '{0}' is an invalid argument for {1}, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrdering.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrdering.verified.txt index 389e14f3..d00e9d5d 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrdering.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrdering.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1003, - Title: Duplicate column ordering, - Severity: Error, - WarningLevel: 0, Location: : (8,5)-(8,19), - MessageFormat: The type '{0}' has two or more properties with the same column order, Message: The type 'ClassWithDuplicateColumnOrdering' has two or more properties with the same column order, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1003, + Title: Duplicate column ordering, + MessageFormat: The type '{0}' has two or more properties with the same column order, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrderingAcrossInheritance.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrderingAcrossInheritance.verified.txt index 80542b44..9cd4912a 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrderingAcrossInheritance.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithDuplicateColumnOrderingAcrossInheritance.verified.txt @@ -1,14 +1,17 @@ { Diagnostics: [ { - Id: SPCH1003, - Title: Duplicate column ordering, - Severity: Error, - WarningLevel: 0, Location: : (7,5)-(7,19), - MessageFormat: The type '{0}' has two or more properties with the same column order, Message: The type 'ClassWithDuplicateColumnOrdering' has two or more properties with the same column order, - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1003, + Title: Duplicate column ordering, + MessageFormat: The type '{0}' has two or more properties with the same column order, + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithInvalidPropertyReferenceColumnHeaders.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithInvalidPropertyReferenceColumnHeaders.verified.txt index 209f96ca..e7128f80 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithInvalidPropertyReferenceColumnHeaders.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithInvalidPropertyReferenceColumnHeaders.verified.txt @@ -1,74 +1,95 @@ { Diagnostics: [ { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (16,5)-(16,63), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'NonExistingProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (18,5)-(18,48), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'name' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (20,5)-(20,85), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'PrivateGetterProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (22,5)-(22,81), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'WriteOnlyProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (24,5)-(24,81), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'NonStringProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (26,5)-(26,80), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'InternalProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: SPCH1004, - Title: Invalid ColumnHeader property reference, - Severity: Error, - WarningLevel: 0, Location: : (28,5)-(28,81), - MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., Message: 'NonStaticProperty' on type 'MyNamespace.ColumnHeaders' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., - Category: SpreadCheetah.SourceGenerator + Severity: Error, + Descriptor: { + Id: SPCH1004, + Title: Invalid ColumnHeader property reference, + MessageFormat: '{0}' on type '{1}' is not a valid property reference. It must be a static property, have a public getter, and the return type must be a string (or string?)., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithNoProperties.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithNoProperties.verified.txt index 645a63b0..5ed68787 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithNoProperties.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithNoProperties.verified.txt @@ -1,14 +1,18 @@ { Diagnostics: [ { - Id: SPCH1001, - Title: Missing properties with public getters, - Severity: Warning, - WarningLevel: 1, Location: : (6,5)-(6,48), - MessageFormat: The type '{0}' has no properties with public getters. This will cause an empty row to be added., Message: The type 'ClassWithNoProperties' has no properties with public getters. This will cause an empty row to be added., - Category: SpreadCheetah.SourceGenerator + Severity: Warning, + WarningLevel: 1, + Descriptor: { + Id: SPCH1001, + Title: Missing properties with public getters, + MessageFormat: The type '{0}' has no properties with public getters. This will cause an empty row to be added., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithUnsupportedProperty.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithUnsupportedProperty.verified.txt index f0137450..1d1a59a2 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithUnsupportedProperty.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ClassWithUnsupportedProperty.verified.txt @@ -1,14 +1,18 @@ { Diagnostics: [ { - Id: SPCH1002, - Title: Unsupported type for cell value, - Severity: Warning, - WarningLevel: 1, Location: : (6,5)-(6,55), - MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., Message: The type 'ClassWithUnsupportedProperty' has a property of type 'Uri' which is not supported as a cell value. The property will be ignored when creating the row., - Category: SpreadCheetah.SourceGenerator + Severity: Warning, + WarningLevel: 1, + Descriptor: { + Id: SPCH1002, + Title: Unsupported type for cell value, + MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ContextWithTwoWorksheetRowAttributesWhenTheFirstTypeEmitsWarning.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ContextWithTwoWorksheetRowAttributesWhenTheFirstTypeEmitsWarning.verified.txt index 71ccb660..9d6c17e0 100644 --- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ContextWithTwoWorksheetRowAttributesWhenTheFirstTypeEmitsWarning.verified.txt +++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_ContextWithTwoWorksheetRowAttributesWhenTheFirstTypeEmitsWarning.verified.txt @@ -1,14 +1,18 @@ { Diagnostics: [ { - Id: SPCH1002, - Title: Unsupported type for cell value, - Severity: Warning, - WarningLevel: 1, Location: : (6,1)-(6,51), - MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., Message: The type 'ClassWithUnsupportedProperty' has a property of type 'Uri' which is not supported as a cell value. The property will be ignored when creating the row., - Category: SpreadCheetah.SourceGenerator + Severity: Warning, + WarningLevel: 1, + Descriptor: { + Id: SPCH1002, + Title: Unsupported type for cell value, + MessageFormat: The type '{0}' has a property of type '{1}' which is not supported as a cell value. The property will be ignored when creating the row., + Category: SpreadCheetah.SourceGenerator, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/SpreadCheetah.Test/SpreadCheetah.Test.csproj b/SpreadCheetah.Test/SpreadCheetah.Test.csproj index 199a84cf..c7daed5c 100644 --- a/SpreadCheetah.Test/SpreadCheetah.Test.csproj +++ b/SpreadCheetah.Test/SpreadCheetah.Test.csproj @@ -15,7 +15,6 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive From 92e301fb6c08b824850ab6cddd9e764dbbed6f48 Mon Sep 17 00:00:00 2001 From: sveinungf Date: Fri, 4 Oct 2024 20:36:22 +0200 Subject: [PATCH 2/5] Set PlatformTarget on Benchmark project to fix issue with missing benchmark results for .NET Framework --- SpreadCheetah.Benchmark/SpreadCheetah.Benchmark.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/SpreadCheetah.Benchmark/SpreadCheetah.Benchmark.csproj b/SpreadCheetah.Benchmark/SpreadCheetah.Benchmark.csproj index 6e2e1753..9a71f2e7 100644 --- a/SpreadCheetah.Benchmark/SpreadCheetah.Benchmark.csproj +++ b/SpreadCheetah.Benchmark/SpreadCheetah.Benchmark.csproj @@ -3,6 +3,7 @@ Exe net48;net6.0;net7.0;net8.0 + AnyCPU From 19c223431e82679e56ad5de4c12d6142a90c81c7 Mon Sep 17 00:00:00 2001 From: sveinungf Date: Fri, 4 Oct 2024 20:58:12 +0200 Subject: [PATCH 3/5] Publish test results with Github Action --- .github/workflows/dotnet.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d1ab77e6..fbf1e546 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -11,15 +11,16 @@ on: jobs: build: + permissions: + checks: write + pull-requests: write runs-on: windows-latest steps: - - name: Configure Git to allow long paths - run: git config --system core.longpaths true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies @@ -27,8 +28,13 @@ jobs: - name: Build run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" + run: dotnet test --no-build --verbosity normal --logger trx --collect:"XPlat Code Coverage" - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/windows@v2 + if: always() + with: + files: ${{ github.workspace }}/**/*.trx From 9144ecf10e5a5543080a4d5dffbe0d3f411d0476 Mon Sep 17 00:00:00 2001 From: sveinungf Date: Fri, 4 Oct 2024 21:14:43 +0200 Subject: [PATCH 4/5] Making test fail to see impact on test report --- SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs b/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs index 62e7af4b..bc4cdae8 100644 --- a/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs +++ b/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs @@ -374,7 +374,7 @@ public async Task Spreadsheet_AddRow_CellWithDoubleValue(double? initialValue, s ("0.1", "0.1"), ("0.0", "0"), ("-0.1", "-0.1"), - ("-0.3333333", "-0.3333333"), + ("-0.3333333", "-1.3333333"), ("0.1111111111111", "0.1111111111111"), ("11.1111111111111", "11.1111111111111"), #if NET472_OR_GREATER From 17b783fb1d031fce717cf6026558f28c55d3afbb Mon Sep 17 00:00:00 2001 From: sveinungf Date: Fri, 4 Oct 2024 21:24:22 +0200 Subject: [PATCH 5/5] Revert "Making test fail to see impact on test report" This reverts commit 9144ecf10e5a5543080a4d5dffbe0d3f411d0476. --- SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs b/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs index bc4cdae8..62e7af4b 100644 --- a/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs +++ b/SpreadCheetah.Test/Tests/SpreadsheetRowTests.cs @@ -374,7 +374,7 @@ public async Task Spreadsheet_AddRow_CellWithDoubleValue(double? initialValue, s ("0.1", "0.1"), ("0.0", "0"), ("-0.1", "-0.1"), - ("-0.3333333", "-1.3333333"), + ("-0.3333333", "-0.3333333"), ("0.1111111111111", "0.1111111111111"), ("11.1111111111111", "11.1111111111111"), #if NET472_OR_GREATER