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 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.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 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