From e8302e0429d51ff07bf0a4e3aa0d1fb246915733 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 09:45:26 +0100 Subject: [PATCH 1/2] chore(deps): Bump cross-spawn in /docs in the npm_and_yarn group (#1601) Bumps the npm_and_yarn group in /docs with 1 update: [cross-spawn](https://github.com/moxystudio/node-cross-spawn). Updates `cross-spawn` from 7.0.3 to 7.0.6 - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package-lock.json | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index a4ac153814..90e2ab6957 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -6518,9 +6518,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -16051,18 +16051,6 @@ "node": ">=8" } }, - "node_modules/stylelint/node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", From 8727f106fc07ad9af5c61c746c937f4018456e56 Mon Sep 17 00:00:00 2001 From: Lars Date: Tue, 19 Nov 2024 11:57:43 +0100 Subject: [PATCH 2/2] upgrade dependencies and switch to .net 9.0 (#1602) --- Directory.Build.props | 2 +- .../Riok.Mapperly.Benchmarks.csproj | 3 +- docs/docs/configuration/generated-source.mdx | 2 +- global.json | 2 +- src/Directory.Build.props | 4 +- test/Directory.Build.props | 18 +- .../Riok.Mapperly.IntegrationTests.csproj | 10 +- .../Riok.Mapperly.Tests.csproj | 2 +- ...thPrivateCtorShouldDiagnostic.verified.txt | 23 ++- ...Case=SourceLowerMissingSource.verified.txt | 22 ++- ...getLowerMissingMultipleSource.verified.txt | 44 +++-- ...getLowerMissingMultipleTarget.verified.txt | 44 +++-- ...Case=TargetLowerMissingTarget.verified.txt | 22 ++- ...e=ByNameMissingMultipleSource.verified.txt | 44 +++-- ...e=ByNameMissingMultipleTarget.verified.txt | 44 +++-- ..._testCase=ByNameMissingSource.verified.txt | 22 ++- ..._testCase=ByNameMissingTarget.verified.txt | 22 ++- ...=ByValueMissingMultipleSource.verified.txt | 44 +++-- ...=ByValueMissingMultipleTarget.verified.txt | 44 +++-- ...testCase=ByValueMissingSource.verified.txt | 22 ++- ...testCase=ByValueMissingTarget.verified.txt | 22 ++- ...OtherEnumByNameWithoutOverlap.verified.txt | 154 +++++++++++++----- ...ReadOnlyArrayShouldDiagnostic.verified.txt | 22 ++- ...teConstructorShouldDiagnostic.verified.txt | 23 ++- ...nboundGenericShouldDiagnostic.verified.txt | 22 ++- ...ccessibleCtorShouldDiagnostic.verified.txt | 23 ++- ...ropertiesPathShouldDiagnostic.verified.txt | 23 ++- ...tedPropertiesShouldDiagnostic.verified.txt | 44 +++-- ...ssPrivateCtorShouldDiagnostic.verified.txt | 23 ++- ...ldDiagnosticAndUseAlternative.verified.txt | 22 ++- ...UnmatchedCtorShouldDiagnostic.verified.txt | 45 +++-- ...ourcePropertyShouldDiagnostic.verified.txt | 22 ++- ...uiredPropertyShouldDiagnostic.verified.txt | 44 +++-- ...meterlessCtorShouldDiagnostic.verified.txt | 23 ++- ...pertyNotFoundShouldDiagnostic.verified.txt | 91 ++++++++--- ...pertyNotFoundShouldDiagnostic.verified.txt | 91 ++++++++--- ...PathWriteOnlyShouldDiagnostic.verified.txt | 90 +++++++--- ...ourcePropertyShouldDiagnostic.verified.txt | 23 ++- ...onfigurationsShouldDiagnostic.verified.txt | 45 +++-- ...onfigurationsShouldDiagnostic.verified.txt | 91 ++++++++--- ...ourceNotFoundShouldDiagnostic.verified.txt | 45 +++-- ...lueToNonNullableIntProperties.verified.txt | 22 ++- ...sensitiveEqualNamesShouldWork.verified.txt | 22 ++- ...opertyOnSourceWithDiagnostics.verified.txt | 66 ++++++-- ...ourcePropertyShouldDiagnostic.verified.txt | 91 ++++++++--- ...argetPropertyShouldDiagnostic.verified.txt | 91 ++++++++--- ...ourcePropertyShouldDiagnostic.verified.txt | 91 ++++++++--- ...tterShouldIgnoreAndDiagnostic.verified.txt | 66 ++++++-- ...tterShouldIgnoreAndDiagnostic.verified.txt | 66 ++++++-- ...eMappingStrategyCaseSensitive.verified.txt | 44 +++-- ...pablePropertyShouldDiagnostic.verified.txt | 91 ++++++++--- ...tchedPropertyShouldDiagnostic.verified.txt | 44 +++-- ...thPathMappingShouldDiagnostic.verified.txt | 25 ++- ...jectionTest.ReferenceLoopCtor.verified.txt | 67 +++++--- ...est.ReferenceLoopInitProperty.verified.txt | 67 +++++--- ...dUsedMappingsAndAmbiguousName.verified.txt | 46 ++++-- ....ClassToClassNonInlinedMethod.verified.txt | 22 ++- ...llyMappedPropertiesShouldWork.verified.txt | 68 +++++--- ...agnosticAndNotBeUsedAsDefault.verified.txt | 47 ++++-- ...arkedAsImplicitDefaultMapping.verified.txt | 22 ++- ...tUserMappingsShouldDiagnostic.verified.txt | 25 ++- ...tUserMappingsShouldDiagnostic.verified.txt | 25 ++- ...ngAttributeOnNonMappingMethod.verified.txt | 25 ++- 63 files changed, 1833 insertions(+), 728 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 415d7d1be1..709bdd8815 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net8.0 + net9.0 true embedded $(MSBuildThisFileDirectory)artifacts diff --git a/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj b/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj index beb52efb02..aa057f29ae 100644 --- a/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj +++ b/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj @@ -18,7 +18,8 @@ runtime; build; native; contentfiles; analyzers - + + diff --git a/docs/docs/configuration/generated-source.mdx b/docs/docs/configuration/generated-source.mdx index 94f1f2772a..8cea90853a 100644 --- a/docs/docs/configuration/generated-source.mdx +++ b/docs/docs/configuration/generated-source.mdx @@ -35,7 +35,7 @@ dotnet build /p:EmitCompilerGeneratedFiles=true By default the files are written to `{BaseIntermediateOutpath}/generated/{Assembly}/Riok.Mapperly/{GeneratedFile}`. -With `BaseIntermediateOutpath` for example being `obj/Debug/net8.0`. +With `BaseIntermediateOutpath` for example being `obj/Debug/net9.0`. By convention, generated C# source code files will have the file extension `.g.cs`. The output path can be customized via the `CompilerGeneratedFilesOutputPath` property. diff --git a/global.json b/global.json index 4f9e9b79a1..2bc13e80ad 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.401", + "version": "9.0.100", "rollForward": "latestMinor" } } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index cb21d50c73..19240a7a38 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -16,11 +16,11 @@ - + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 78f6f865da..e6c56cc3dc 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -11,10 +11,10 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -26,11 +26,11 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - + + + + + all runtime; build; native; contentfiles; analyzers diff --git a/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj b/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj index f1b0b4bc70..af4515971f 100644 --- a/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj +++ b/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj @@ -2,7 +2,7 @@ - net8.0 + net9.0 $(MapperlyIntegrationTestsTargetFramework) true @@ -36,18 +36,18 @@ - + - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj b/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj index 57db2b5e0e..f2c6ccb4f0 100644 --- a/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj +++ b/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/test/Riok.Mapperly.Tests/_snapshots/DictionaryCustomTest.DictionaryToCustomDictionaryWithPrivateCtorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/DictionaryCustomTest.DictionaryToCustomDictionaryWithPrivateCtorShouldDiagnostic.verified.txt index 4cc99f1d01..9b59af6f5e 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/DictionaryCustomTest.DictionaryToCustomDictionaryWithPrivateCtorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/DictionaryCustomTest.DictionaryToCustomDictionaryWithPrivateCtorShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG013, - Title: No accessible constructor with mappable arguments found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,59), - MessageFormat: {0} has no accessible constructor with mappable arguments, + Location: /* +{ + private partial A Map(IDictionary source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,59), Message: A has no accessible constructor with mappable arguments, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG013, + Title: No accessible constructor with mappable arguments found, + MessageFormat: {0} has no accessible constructor with mappable arguments, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=SourceLowerMissingSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=SourceLowerMissingSource.verified.txt index edfc865ddb..dfb8394693 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=SourceLowerMissingSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=SourceLowerMissingSource.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value3 (1) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value3 (1) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleSource.verified.txt index 5ff2ed9020..0aaf6014fe 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleSource.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member value5 (0) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member value5 (0) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member value7 (2) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member value7 (2) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleTarget.verified.txt index 6bd08a8331..bf6e8a9b01 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingMultipleTarget.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value5 (0) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value5 (0) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value7 (2) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value7 (2) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingTarget.verified.txt index 11aa939768..b27d301116 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByNameCaseInsensitive_testCase=TargetLowerMissingTarget.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value5 (1) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value5 (1) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleSource.verified.txt index e6fb6d62e7..3cc706c584 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleSource.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value2 (1) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value3 (2) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value3 (2) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleTarget.verified.txt index fc390fbac5..769edea01c 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingMultipleTarget.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value2 (1) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value3 (2) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value3 (2) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingSource.verified.txt index 9ddeabbbda..7bd43d2719 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingSource.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value2 (1) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingTarget.verified.txt index a374defe2b..c028cb95bd 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByNameMissingTarget.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value2 (1) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleSource.verified.txt index e6fb6d62e7..3cc706c584 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleSource.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value2 (1) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value3 (2) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value3 (2) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleTarget.verified.txt index fc390fbac5..769edea01c 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingMultipleTarget.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value2 (1) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value3 (2) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value3 (2) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingSource.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingSource.verified.txt index 9ddeabbbda..7bd43d2719 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingSource.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingSource.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on D not found on source enum C, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member Value2 (1) on D not found on source enum C, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingTarget.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingTarget.verified.txt index a374defe2b..c028cb95bd 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingTarget.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToAnotherEnumByStrategyMissingValues_testCase=ByValueMissingTarget.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Enum member Value2 (1) on C not found on target enum D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member Value2 (1) on C not found on target enum D, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToOtherEnumByNameWithoutOverlap.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToOtherEnumByNameWithoutOverlap.verified.txt index 2e5ec9a495..636c93d553 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToOtherEnumByNameWithoutOverlap.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumTest.EnumToOtherEnumByNameWithoutOverlap.verified.txt @@ -1,74 +1,144 @@ { Diagnostics: [ { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member A (0) on E1 not found on target enum E2, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member A (0) on E1 not found on target enum E2, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member B (1) on E1 not found on target enum E2, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member B (1) on E1 not found on target enum E2, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG038, - Title: An enum member could not be found on the target enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member C (2) on E1 not found on target enum E2, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, - Message: Enum member C (2) on E1 not found on target enum E2, - Category: Mapper + Descriptor: { + Id: RMG038, + Title: An enum member could not be found on the target enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on target enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member D (0) on E2 not found on source enum E1, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member D (0) on E2 not found on source enum E1, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member E (1) on E2 not found on source enum E1, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member E (1) on E2 not found on source enum E1, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG037, - Title: An enum member could not be found on the source enum, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: Enum member F (2) on E2 not found on source enum E1, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, - Message: Enum member F (2) on E2 not found on source enum E1, - Category: Mapper + Descriptor: { + Id: RMG037, + Title: An enum member could not be found on the source enum, + MessageFormat: Enum member {0} ({1}) on {2} not found on source enum {3}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG003, - Title: No overlapping enum members found, + Location: /* +{ + [MapEnum(EnumMappingStrategy.ByName)] private partial E2 ToE1(E1 source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,77), + Message: E1 and E2 don't have overlapping enum member names, mapping will therefore always result in an exception, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,77), - MessageFormat: {0} and {1} don't have overlapping enum member names, mapping will therefore always result in an exception, - Message: E1 and E2 don't have overlapping enum member names, mapping will therefore always result in an exception, - Category: Mapper + Descriptor: { + Id: RMG003, + Title: No overlapping enum members found, + MessageFormat: {0} and {1} don't have overlapping enum member names, mapping will therefore always result in an exception, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic.verified.txt index c31a53ff6e..6bb5551cd3 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG083, - Title: Cannot map to read only type, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Cannot map to read-only type int[], Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Cannot map to read-only type {0}, - Message: Cannot map to read-only type int[], - Category: Mapper + Descriptor: { + Id: RMG083, + Title: Cannot map to read only type, + MessageFormat: Cannot map to read-only type {0}, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.NullableElementMappingWithPrivateConstructorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.NullableElementMappingWithPrivateConstructorShouldDiagnostic.verified.txt index 7bb58b40bf..8208726fed 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.NullableElementMappingWithPrivateConstructorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.NullableElementMappingWithPrivateConstructorShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG013, - Title: No accessible constructor with mappable arguments found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,36), - MessageFormat: {0} has no accessible constructor with mappable arguments, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), Message: C has no accessible constructor with mappable arguments, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG013, + Title: No accessible constructor with mappable arguments found, + MessageFormat: {0} has no accessible constructor with mappable arguments, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/GenericTest.WithGenericSourceAndTargetAndUnboundGenericShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/GenericTest.WithGenericSourceAndTargetAndUnboundGenericShouldDiagnostic.verified.txt index 8f014fbe6f..040d748dec 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/GenericTest.WithGenericSourceAndTargetAndUnboundGenericShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/GenericTest.WithGenericSourceAndTargetAndUnboundGenericShouldDiagnostic.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG069, - Title: Runtime target type or generic type mapping does not match any mappings, + Location: /* +{ + private partial TTarget Map(TSource source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +*/ + : (11,4)-(11,76), + Message: Runtime target type or generic type mapping does not match any mappings, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,76), - MessageFormat: Runtime target type or generic type mapping does not match any mappings, - Message: Runtime target type or generic type mapping does not match any mappings, - Category: Mapper + Descriptor: { + Id: RMG069, + Title: Runtime target type or generic type mapping does not match any mappings, + MessageFormat: Runtime target type or generic type mapping does not match any mappings, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/NullableTest.NullableToNonNullableWithNoThrowNoAccessibleCtorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/NullableTest.NullableToNonNullableWithNoThrowNoAccessibleCtorShouldDiagnostic.verified.txt index 8ab27f127d..405714559a 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/NullableTest.NullableToNonNullableWithNoThrowNoAccessibleCtorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/NullableTest.NullableToNonNullableWithNoThrowNoAccessibleCtorShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG002, - Title: No accessible parameterless constructor found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,42), - MessageFormat: {0} has no accessible parameterless constructor, + Location: /* +{ + private partial B Map(string? source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,42), Message: B has no accessible parameterless constructor, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG002, + Title: No accessible parameterless constructor found, + MessageFormat: {0} has no accessible parameterless constructor, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.InvalidNestedPropertiesPathShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.InvalidNestedPropertiesPathShouldDiagnostic.verified.txt index 4b254245f7..c36b19fcd4 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.InvalidNestedPropertiesPathShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.InvalidNestedPropertiesPathShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG070, - Title: Mapping nested member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,59), - MessageFormat: Specified nested member {0} on source type {1} was not found, + Location: /* +{ + [MapNestedProperties("Value")] partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,59), Message: Specified nested member Value on source type A was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG070, + Title: Mapping nested member not found, + MessageFormat: Specified nested member {0} on source type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.UnusedNestedPropertiesShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.UnusedNestedPropertiesShouldDiagnostic.verified.txt index a9f962dea8..6616f7b026 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.UnusedNestedPropertiesShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectNestedPropertyTest.UnusedNestedPropertiesShouldDiagnostic.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapNestedProperties(nameof(A.Value))] partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,67), + Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,67), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG071, - Title: Nested properties mapping is not used, + Location: /* +{ + [MapNestedProperties(nameof(A.Value))] partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,67), + Message: Configured nested member Value on source type A is not used, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,67), - MessageFormat: Configured nested member {0} on source type {1} is not used, - Message: Configured nested member Value on source type A is not used, - Category: Mapper + Descriptor: { + Id: RMG071, + Title: Nested properties mapping is not used, + MessageFormat: Configured nested member {0} on source type {1} is not used, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassPrivateCtorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassPrivateCtorShouldDiagnostic.verified.txt index 9f2412c70c..4b0459d2b8 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassPrivateCtorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassPrivateCtorShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG013, - Title: No accessible constructor with mappable arguments found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,36), - MessageFormat: {0} has no accessible constructor with mappable arguments, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), Message: B has no accessible constructor with mappable arguments, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG013, + Title: No accessible constructor with mappable arguments found, + MessageFormat: {0} has no accessible constructor with mappable arguments, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedAttributedCtorShouldDiagnosticAndUseAlternative.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedAttributedCtorShouldDiagnosticAndUseAlternative.verified.txt index 1e95a4500b..9661c93b31 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedAttributedCtorShouldDiagnosticAndUseAlternative.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedAttributedCtorShouldDiagnosticAndUseAlternative.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG014, - Title: Cannot map to the configured constructor to be used by Mapperly, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Cannot map from A to the configured constructor B.B(string), Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Cannot map from {0} to the configured constructor {1}, - Message: Cannot map from A to the configured constructor B.B(string), - Category: Mapper + Descriptor: { + Id: RMG014, + Title: Cannot map to the configured constructor to be used by Mapperly, + MessageFormat: Cannot map from {0} to the configured constructor {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedCtorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedCtorShouldDiagnostic.verified.txt index 2e323841ef..0d37939ec2 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedCtorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassUnmatchedCtorShouldDiagnostic.verified.txt @@ -1,24 +1,43 @@ { Diagnostics: [ { - Id: RMG013, - Title: No accessible constructor with mappable arguments found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,36), - MessageFormat: {0} has no accessible constructor with mappable arguments, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), Message: B has no accessible constructor with mappable arguments, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG013, + Title: No accessible constructor with mappable arguments found, + MessageFormat: {0} has no accessible constructor with mappable arguments, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassWithOneMatchingCtorAndUnmatchedSourcePropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassWithOneMatchingCtorAndUnmatchedSourcePropertyShouldDiagnostic.verified.txt index 5b6c80d54a..d31fed6ca0 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassWithOneMatchingCtorAndUnmatchedSourcePropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyConstructorResolverTest.ClassToClassWithOneMatchingCtorAndUnmatchedSourcePropertyShouldDiagnostic.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member IntValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member IntValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyExistingInstanceTest.UnmappedRequiredPropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyExistingInstanceTest.UnmappedRequiredPropertyShouldDiagnostic.verified.txt index 72e26bde98..802003a671 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyExistingInstanceTest.UnmappedRequiredPropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyExistingInstanceTest.UnmappedRequiredPropertyShouldDiagnostic.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + public partial void Update(A source, B target); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,51), + Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,51), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + public partial void Update(A source, B target); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,51), + Message: The member Value2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,51), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyNullablePathNoParameterlessCtorShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyNullablePathNoParameterlessCtorShouldDiagnostic.verified.txt index f2556c605e..6d46f4158c 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyNullablePathNoParameterlessCtorShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyNullablePathNoParameterlessCtorShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG002, - Title: No accessible parameterless constructor found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,75), - MessageFormat: {0} has no accessible parameterless constructor, + Location: /* +{ + [MapProperty("MyValueId", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,75), Message: C has no accessible parameterless constructor, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG002, + Title: No accessible parameterless constructor found, + MessageFormat: {0} has no accessible parameterless constructor, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertySourcePropertyNotFoundShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertySourcePropertyNotFoundShouldDiagnostic.verified.txt index 1a2d3a9fbb..1d64212c94 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertySourcePropertyNotFoundShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertySourcePropertyNotFoundShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG006, - Title: Mapping source member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,78), - MessageFormat: Specified member {0} on source type {1} was not found, + Location: /* +{ + [MapProperty("MyValueIdXXX", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), Message: Specified member MyValueIdXXX on source type A was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG006, + Title: Mapping source member not found, + MessageFormat: Specified member {0} on source type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("MyValueIdXXX", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("MyValueIdXXX", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty("MyValueIdXXX", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyNotFoundShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyNotFoundShouldDiagnostic.verified.txt index 000e1e3265..e2673c790e 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyNotFoundShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyNotFoundShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG005, - Title: Mapping target member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,78), - MessageFormat: Specified member {0} on mapping target type {1} was not found, + Location: /* +{ + [MapProperty("MyValueId", "Value.IdXXX")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), Message: Specified member Value.IdXXX on mapping target type B was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG005, + Title: Mapping target member not found, + MessageFormat: Specified member {0} on mapping target type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("MyValueId", "Value.IdXXX")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("MyValueId", "Value.IdXXX")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty("MyValueId", "Value.IdXXX")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,78), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,78), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyPathWriteOnlyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyPathWriteOnlyShouldDiagnostic.verified.txt index d4c7a8f2c2..16e1ee9a50 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyPathWriteOnlyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyFlatteningTest.ManualUnflattenedPropertyTargetPropertyPathWriteOnlyShouldDiagnostic.verified.txt @@ -1,45 +1,85 @@ { Diagnostics: [ { - Id: RMG011, - Title: Cannot map to write only member path, + Location: /* +{ + [MapProperty($"MyValueId", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,76), + Message: Cannot map from A.MyValueId to write only member path B.Value.Id of type string, Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,76), - MessageFormat: Cannot map from {0} to write only member path {1}, - Message: Cannot map from A.MyValueId to write only member path B.Value.Id of type string, - Category: Mapper + Descriptor: { + Id: RMG011, + Title: Cannot map to write only member path, + MessageFormat: Cannot map from {0} to write only member path {1}, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty($"MyValueId", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,76), + Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,76), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member MyValueId on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty($"MyValueId", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,76), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,76), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty($"MyValueId", "Value.Id")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,76), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,76), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithConfigurationNotFoundSourcePropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithConfigurationNotFoundSourcePropertyShouldDiagnostic.verified.txt index beef16c901..6d085e8691 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithConfigurationNotFoundSourcePropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithConfigurationNotFoundSourcePropertyShouldDiagnostic.verified.txt @@ -1,14 +1,23 @@ { Diagnostics: [ { - Id: RMG006, - Title: Mapping source member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,81), - MessageFormat: Specified member {0} on source type {1} was not found, + Location: /* +{ + [MapProperty("StringValue2", "StringValue")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,81), Message: Specified member StringValue2 on source type A was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG006, + Title: Mapping source member not found, + MessageFormat: Specified member {0} on source type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithMultipleConfigurationsShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithMultipleConfigurationsShouldDiagnostic.verified.txt index a5c457ebbe..de8b172425 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithMultipleConfigurationsShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithMultipleConfigurationsShouldDiagnostic.verified.txt @@ -1,24 +1,43 @@ { Diagnostics: [ { - Id: RMG074, - Title: Multiple mappings are configured for the same target member, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,126), - MessageFormat: Multiple mappings are configured for the same target member {0}.{1}, + Location: /* +{ + [MapProperty("StringValue2", "StringValue")] [MapProperty("StringValue3", "StringValue")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,126), Message: Multiple mappings are configured for the same target member B.StringValue, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG074, + Title: Multiple mappings are configured for the same target member, + MessageFormat: Multiple mappings are configured for the same target member {0}.{1}, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("StringValue2", "StringValue")] [MapProperty("StringValue3", "StringValue")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,126), + Message: The member StringValue3 on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,126), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue3 on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithPathConfigurationsShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithPathConfigurationsShouldDiagnostic.verified.txt index 5594ea3771..421c31dfcf 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithPathConfigurationsShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.InitOnlyPropertyWithPathConfigurationsShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG016, - Title: Init only member cannot handle target paths, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,81), - MessageFormat: Cannot map to init only member path {0}.{1}, + Location: /* +{ + [MapProperty("NestedValue", "Nested.Value")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,81), Message: Cannot map to init only member path B.Nested.Value, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG016, + Title: Init only member cannot handle target paths, + MessageFormat: Cannot map to init only member path {0}.{1}, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("NestedValue", "Nested.Value")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,81), + Message: The member Nested on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,81), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Nested on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("NestedValue", "Nested.Value")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,81), + Message: The member NestedValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,81), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member NestedValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty("NestedValue", "Nested.Value")] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,81), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,81), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.RequiredPropertySourceNotFoundShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.RequiredPropertySourceNotFoundShouldDiagnostic.verified.txt index 5ce54e6aae..0ba246d54f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.RequiredPropertySourceNotFoundShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyInitPropertyTest.RequiredPropertySourceNotFoundShouldDiagnostic.verified.txt @@ -1,24 +1,43 @@ { Diagnostics: [ { - Id: RMG023, - Title: Source member was not found for required target member, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,36), - MessageFormat: Required member {0} on mapping target type {1} was not found on the mapping source type {2}, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), Message: Required member StringValue on mapping target type B was not found on the mapping source type A, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG023, + Title: Source member was not found for required target member, + MessageFormat: Required member {0} on mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue2 on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue2 on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.NullableIntWithAdditionalFlattenedValueToNonNullableIntProperties.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.NullableIntWithAdditionalFlattenedValueToNonNullableIntProperties.verified.txt index 04a17fd708..9ddf4ce133 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.NullableIntWithAdditionalFlattenedValueToNonNullableIntProperties.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.NullableIntWithAdditionalFlattenedValueToNonNullableIntProperties.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member Value2 on the mapping source type C is not mapped to any member on the mapping target type D, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Value2 on the mapping source type C is not mapped to any member on the mapping target type D, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.PropertiesWithCaseInsensitiveEqualNamesShouldWork.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.PropertiesWithCaseInsensitiveEqualNamesShouldWork.verified.txt index c60321795e..3c1e3ebbc1 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.PropertiesWithCaseInsensitiveEqualNamesShouldWork.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.PropertiesWithCaseInsensitiveEqualNamesShouldWork.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.ShouldIgnoreWriteOnlyPropertyOnSourceWithDiagnostics.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.ShouldIgnoreWriteOnlyPropertyOnSourceWithDiagnostics.verified.txt index 4c6174ba56..611f4098ae 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.ShouldIgnoreWriteOnlyPropertyOnSourceWithDiagnostics.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.ShouldIgnoreWriteOnlyPropertyOnSourceWithDiagnostics.verified.txt @@ -1,34 +1,64 @@ { Diagnostics: [ { - Id: RMG010, - Title: Cannot map from write only member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Cannot map from write only member A.StringValue2 of type string to member B.StringValue2 of type string, Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Cannot map from write only member {0} to member {1}, - Message: Cannot map from write only member A.StringValue2 of type string to member B.StringValue2 of type string, - Category: Mapper + Descriptor: { + Id: RMG010, + Title: Cannot map from write only member, + MessageFormat: Cannot map from write only member {0} to member {1}, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue2 on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue2 on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundSourcePropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundSourcePropertyShouldDiagnostic.verified.txt index c252ee2f3c..75cc14536a 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundSourcePropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundSourcePropertyShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG006, - Title: Mapping source member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,89), - MessageFormat: Specified member {0} on source type {1} was not found, + Location: /* +{ + [MapProperty("StringValue9", nameof(B.StringValue2)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,89), Message: Specified member StringValue9 on source type A was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG006, + Title: Mapping source member not found, + MessageFormat: Specified member {0} on source type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("StringValue9", nameof(B.StringValue2)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,89), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,89), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("StringValue9", nameof(B.StringValue2)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,89), + Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,89), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty("StringValue9", nameof(B.StringValue2)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,89), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,89), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundTargetPropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundTargetPropertyShouldDiagnostic.verified.txt index c92eaf4656..37d0b347d0 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundTargetPropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualMappedNotFoundTargetPropertyShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG005, - Title: Mapping target member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,96), - MessageFormat: Specified member {0} on mapping target type {1} was not found, + Location: /* +{ + [MapProperty(nameof(A.StringValue), nameof(B.StringValue9)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,96), Message: Specified member StringValue9 on mapping target type B was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG005, + Title: Mapping target member not found, + MessageFormat: Specified member {0} on mapping target type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty(nameof(A.StringValue), nameof(B.StringValue9)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,96), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,96), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty(nameof(A.StringValue), nameof(B.StringValue9)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,96), + Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,96), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty(nameof(A.StringValue), nameof(B.StringValue9)] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,96), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,96), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualNotFoundSourcePropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualNotFoundSourcePropertyShouldDiagnostic.verified.txt index 030cedf843..e1a4f5551f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualNotFoundSourcePropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithManualNotFoundSourcePropertyShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG006, - Title: Mapping source member not found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,87), - MessageFormat: Specified member {0} on source type {1} was not found, + Location: /* +{ + [MapProperty("not_found", nameof(B.StringValue2))] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,87), Message: Specified member not_found on source type A was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG006, + Title: Mapping source member not found, + MessageFormat: Specified member {0} on source type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + [MapProperty("not_found", nameof(B.StringValue2))] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,87), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,87), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("not_found", nameof(B.StringValue2))] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,87), + Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,87), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValue2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + [MapProperty("not_found", nameof(B.StringValue2))] private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,87), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,87), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourceGetterShouldIgnoreAndDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourceGetterShouldIgnoreAndDiagnostic.verified.txt index c077ccac5e..a6ffa97e83 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourceGetterShouldIgnoreAndDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourceGetterShouldIgnoreAndDiagnostic.verified.txt @@ -1,34 +1,64 @@ { Diagnostics: [ { - Id: RMG010, - Title: Cannot map from write only member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Cannot map from write only member A.StringValue of type string to member B.StringValue of type string, Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Cannot map from write only member {0} to member {1}, - Message: Cannot map from write only member A.StringValue of type string to member B.StringValue of type string, - Category: Mapper + Descriptor: { + Id: RMG010, + Title: Cannot map from write only member, + MessageFormat: Cannot map from write only member {0} to member {1}, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValue on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourcePathGetterShouldIgnoreAndDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourcePathGetterShouldIgnoreAndDiagnostic.verified.txt index dfa97e1103..ea50b29ab5 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourcePathGetterShouldIgnoreAndDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPrivateSourcePathGetterShouldIgnoreAndDiagnostic.verified.txt @@ -1,34 +1,64 @@ { Diagnostics: [ { - Id: RMG010, - Title: Cannot map from write only member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: Cannot map from write only member A.NestedValue of type C to member B.NestedValue of type D, Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: Cannot map from write only member {0} to member {1}, - Message: Cannot map from write only member A.NestedValue of type C to member B.NestedValue of type D, - Category: Mapper + Descriptor: { + Id: RMG010, + Title: Cannot map from write only member, + MessageFormat: Cannot map from write only member {0} to member {1}, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member NestedValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member NestedValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member NestedValue on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member NestedValue on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPropertyNameMappingStrategyCaseSensitive.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPropertyNameMappingStrategyCaseSensitive.verified.txt index 4d7e4d9c1f..1cdaf2ee3f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPropertyNameMappingStrategyCaseSensitive.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithPropertyNameMappingStrategyCaseSensitive.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValue on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member stringvalue on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member stringvalue on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmappablePropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmappablePropertyShouldDiagnostic.verified.txt index 0aa57b2164..eedbb54799 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmappablePropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmappablePropertyShouldDiagnostic.verified.txt @@ -1,45 +1,84 @@ { Diagnostics: [ { - Id: RMG007, - Title: Could not map member, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,36), - MessageFormat: Could not map member {0} to {1}, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), Message: Could not map member A.Value of type System.Version to B.Value of type System.DateTime, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG007, + Title: Could not map member, + MessageFormat: Could not map member {0} to {1}, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Value on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG066, - Title: No members are mapped in an object mapping, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: No members are mapped in the object mapping from A to B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, - MessageFormat: No members are mapped in the object mapping from {0} to {1}, - Message: No members are mapped in the object mapping from A to B, - Category: Mapper + Descriptor: { + Id: RMG066, + Title: No members are mapped in an object mapping, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG066, + MessageFormat: No members are mapped in the object mapping from {0} to {1}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmatchedPropertyShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmatchedPropertyShouldDiagnostic.verified.txt index 3f44eac40c..49aac48718 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmatchedPropertyShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyTest.WithUnmatchedPropertyShouldDiagnostic.verified.txt @@ -1,24 +1,44 @@ { Diagnostics: [ { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValueA on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member StringValueA on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial B Map(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,36), + Message: The member StringValueB on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,36), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member StringValueB on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.CtorWithPathMappingShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.CtorWithPathMappingShouldDiagnostic.verified.txt index 083fa08877..9122fa95ac 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.CtorWithPathMappingShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.CtorWithPathMappingShouldDiagnostic.verified.txt @@ -1,14 +1,25 @@ { Diagnostics: [ { - Id: RMG005, - Title: Mapping target member not found, - Severity: Error, - WarningLevel: 0, - Location: : (13,0)-(14,35), - MessageFormat: Specified member {0} on mapping target type {1} was not found, + Location: /* + +[MapProperty("Value1", "ValueC.Value3")] +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +private partial B MapObj(A source); +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (13,0)-(14,35), Message: Specified member ValueC.Value3 on mapping target type B was not found, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG005, + Title: Mapping target member not found, + MessageFormat: Specified member {0} on mapping target type {1} was not found, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopCtor.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopCtor.verified.txt index 290b35ce47..ed537c8e05 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopCtor.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopCtor.verified.txt @@ -1,34 +1,63 @@ { Diagnostics: [ { - Id: RMG031, - Title: Reference loop detected while mapping to a constructor parameter, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), + Message: Reference loop detected while mapping from A.Parent to the constructor parameter parent of B, consider ignoring this member or mark another constructor as mapping constructor, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,84), - MessageFormat: Reference loop detected while mapping from {0} to the constructor parameter {2} of {1}, consider ignoring this member or mark another constructor as mapping constructor, - Message: Reference loop detected while mapping from A.Parent to the constructor parameter parent of B, consider ignoring this member or mark another constructor as mapping constructor, - Category: Mapper + Descriptor: { + Id: RMG031, + Title: Reference loop detected while mapping to a constructor parameter, + MessageFormat: Reference loop detected while mapping from {0} to the constructor parameter {2} of {1}, consider ignoring this member or mark another constructor as mapping constructor, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG013, - Title: No accessible constructor with mappable arguments found, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,84), - MessageFormat: {0} has no accessible constructor with mappable arguments, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), Message: B has no accessible constructor with mappable arguments, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG013, + Title: No accessible constructor with mappable arguments found, + MessageFormat: {0} has no accessible constructor with mappable arguments, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), + Message: The member Parent on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,84), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Parent on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopInitProperty.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopInitProperty.verified.txt index e4ac1bc145..7ae259b0cb 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopInitProperty.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionTest.ReferenceLoopInitProperty.verified.txt @@ -1,34 +1,63 @@ { Diagnostics: [ { - Id: RMG030, - Title: Reference loop detected while mapping to an init only member, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(11,84), - MessageFormat: Reference loop detected while mapping from {0} to the init only member {1}, consider ignoring this member, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), Message: Reference loop detected while mapping from A.Parent to the init only member B.Parent, consider ignoring this member, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG030, + Title: Reference loop detected while mapping to an init only member, + MessageFormat: Reference loop detected while mapping from {0} to the init only member {1}, consider ignoring this member, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG020, - Title: Source member is not mapped to any target member, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), + Message: The member Parent on the mapping source type A is not mapped to any member on the mapping target type B, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,84), - MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, - Message: The member Parent on the mapping source type A is not mapped to any member on the mapping target type B, - Category: Mapper + Descriptor: { + Id: RMG020, + Title: Source member is not mapped to any target member, + MessageFormat: The member {0} on the mapping source type {1} is not mapped to any member on the mapping target type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (11,4)-(11,84), + Message: The member Parent on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,84), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Parent on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUseNamedMappingTest.TwoQueryableMappingsWithNamedUsedMappingsAndAmbiguousName.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUseNamedMappingTest.TwoQueryableMappingsWithNamedUsedMappingsAndAmbiguousName.verified.txt index a2b40d8f22..9adf3dc393 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUseNamedMappingTest.TwoQueryableMappingsWithNamedUsedMappingsAndAmbiguousName.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUseNamedMappingTest.TwoQueryableMappingsWithNamedUsedMappingsAndAmbiguousName.verified.txt @@ -1,24 +1,42 @@ { Diagnostics: [ { - Id: RMG062, - Title: The referenced mapping name is ambiguous, - Severity: Error, - WarningLevel: 0, - Location: : (14,1)-(14,87), - MessageFormat: The referenced mapping name {0} is ambiguous, use a unique name, + Location: /* + +[MapProperty(nameof(A.StringValue1), nameof(B.StringValue1), Use = nameof(ModifyString)] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +[MapProperty(nameof(A.StringValue2), nameof(B.StringValue2), Use = nameof(ModifyString2)] +*/ + : (14,1)-(14,87), Message: The referenced mapping name ModifyString is ambiguous, use a unique name, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG062, + Title: The referenced mapping name is ambiguous, + MessageFormat: The referenced mapping name {0} is ambiguous, use a unique name, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG062, - Title: The referenced mapping name is ambiguous, - Severity: Error, - WarningLevel: 0, - Location: : (14,1)-(14,87), - MessageFormat: The referenced mapping name {0} is ambiguous, use a unique name, + Location: /* + +[MapProperty(nameof(A.StringValue1), nameof(B.StringValue1), Use = nameof(ModifyString)] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +[MapProperty(nameof(A.StringValue2), nameof(B.StringValue2), Use = nameof(ModifyString2)] +*/ + : (14,1)-(14,87), Message: The referenced mapping name ModifyString is ambiguous, use a unique name, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG062, + Title: The referenced mapping name is ambiguous, + MessageFormat: The referenced mapping name {0} is ambiguous, use a unique name, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUserImplementedTest.ClassToClassNonInlinedMethod.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUserImplementedTest.ClassToClassNonInlinedMethod.verified.txt index 7186af5608..da49383824 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUserImplementedTest.ClassToClassNonInlinedMethod.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionUserImplementedTest.ClassToClassNonInlinedMethod.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG068, - Title: Cannot inline user implemented queryable expression mapping, + Location: /* +{ + private partial System.Linq.IQueryable Map(System.Linq.IQueryable source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +*/ + : (11,4)-(11,84), + Message: Cannot inline user implemented queryable expression mapping, Severity: Info, WarningLevel: 1, - Location: : (11,4)-(11,84), - MessageFormat: Cannot inline user implemented queryable expression mapping, - Message: Cannot inline user implemented queryable expression mapping, - Category: Mapper + Descriptor: { + Id: RMG068, + Title: Cannot inline user implemented queryable expression mapping, + MessageFormat: Cannot inline user implemented queryable expression mapping, + Category: Mapper, + DefaultSeverity: Info, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ReferenceHandlingTest.ManuallyMappedPropertiesShouldWork.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/ReferenceHandlingTest.ManuallyMappedPropertiesShouldWork.verified.txt index e26ebb7473..c1b2c04461 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ReferenceHandlingTest.ManuallyMappedPropertiesShouldWork.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/ReferenceHandlingTest.ManuallyMappedPropertiesShouldWork.verified.txt @@ -1,35 +1,65 @@ { Diagnostics: [ { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +{ + [MapProperty("Value", "MyValue")] private partial B MapToB(A source); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +[MapProperty("Value", "MyValue2")] private partial B MapToB1(A source); +*/ + : (11,4)-(11,73), + Message: The member MyValue2 on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (11,4)-(11,73), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member MyValue2 on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* + [MapProperty("Value", "MyValue")] private partial B MapToB(A source); +[MapProperty("Value", "MyValue2")] private partial B MapToB1(A source); +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (12,0)-(12,71), + Message: The member MyValue on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (12,0)-(12,71), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member MyValue on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } }, { - Id: RMG060, - Title: Multiple user mappings discovered without specifying an explicit default, + Location: /* + [MapProperty("Value", "MyValue")] private partial B MapToB(A source); +[MapProperty("Value", "MyValue2")] private partial B MapToB1(A source); +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (12,0)-(12,71), + Message: Multiple user mappings discovered for the mapping from A to B without specifying an explicit default, Severity: Warning, WarningLevel: 1, - Location: : (12,0)-(12,71), - HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG060, - MessageFormat: Multiple user mappings discovered for the mapping from {0} to {1} without specifying an explicit default, - Message: Multiple user mappings discovered for the mapping from A to B without specifying an explicit default, - Category: Mapper + Descriptor: { + Id: RMG060, + Title: Multiple user mappings discovered without specifying an explicit default, + HelpLink: https://localhost:3000/docs/configuration/analyzer-diagnostics/RMG060, + MessageFormat: Multiple user mappings discovered for the mapping from {0} to {1} without specifying an explicit default, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ExplicitDefaultShouldDiagnosticAndNotBeUsedAsDefault.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ExplicitDefaultShouldDiagnosticAndNotBeUsedAsDefault.verified.txt index 2b3eb1b661..551c3385d4 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ExplicitDefaultShouldDiagnosticAndNotBeUsedAsDefault.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ExplicitDefaultShouldDiagnosticAndNotBeUsedAsDefault.verified.txt @@ -1,24 +1,45 @@ { Diagnostics: [ { - Id: RMG081, - Title: A mapping method with additional parameters cannot be a default mapping, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(12,32), - MessageFormat: The mapping method {0} has additional parameters and therefore cannot be a default mapping, + Location: /* +{ + [UserMapping(Default = true)] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +partial B Map(A src, int value); +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +partial E MapNested(D src); +*/ + : (11,4)-(12,32), Message: The mapping method Map has additional parameters and therefore cannot be a default mapping, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG081, + Title: A mapping method with additional parameters cannot be a default mapping, + MessageFormat: The mapping method {0} has additional parameters and therefore cannot be a default mapping, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } }, { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* +partial B Map(A src, int value); +partial E MapNested(D src); +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (13,0)-(13,27), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (13,0)-(13,27), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ShouldNotBeMarkedAsImplicitDefaultMapping.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ShouldNotBeMarkedAsImplicitDefaultMapping.verified.txt index ca55107bb2..b10a346bd7 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ShouldNotBeMarkedAsImplicitDefaultMapping.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodAdditionalParametersTest.ShouldNotBeMarkedAsImplicitDefaultMapping.verified.txt @@ -1,14 +1,24 @@ { Diagnostics: [ { - Id: RMG012, - Title: Source member was not found for target member, + Location: /* + partial B Map(A src, int value); +partial E MapNested(D src); +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} +*/ + : (12,0)-(12,27), + Message: The member Value on the mapping target type B was not found on the mapping source type A, Severity: Warning, WarningLevel: 1, - Location: : (12,0)-(12,27), - MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, - Message: The member Value on the mapping target type B was not found on the mapping source type A, - Category: Mapper + Descriptor: { + Id: RMG012, + Title: Source member was not found for target member, + MessageFormat: The member {0} on the mapping target type {1} was not found on the mapping source type {2}, + Category: Mapper, + DefaultSeverity: Warning, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.DisabledAutoUserMappingsMultipleDefaultUserMappingsShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.DisabledAutoUserMappingsMultipleDefaultUserMappingsShouldDiagnostic.verified.txt index 7296d18baa..3aef187a7b 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.DisabledAutoUserMappingsMultipleDefaultUserMappingsShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.DisabledAutoUserMappingsMultipleDefaultUserMappingsShouldDiagnostic.verified.txt @@ -1,14 +1,25 @@ { Diagnostics: [ { - Id: RMG059, - Title: Multiple default user mappings found, only one is allowed, - Severity: Error, - WarningLevel: 0, - Location: : (14,0)-(15,47), - MessageFormat: Multiple default user mappings for the mapping from {0} to {1} found, only one is allowed, + Location: /* + +[UserMapping(Default = true)] +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +public static int IntMapping2(int x) => x + 20; +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +*/ + : (14,0)-(15,47), Message: Multiple default user mappings for the mapping from int to int found, only one is allowed, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG059, + Title: Multiple default user mappings found, only one is allowed, + MessageFormat: Multiple default user mappings for the mapping from {0} to {1} found, only one is allowed, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.MultipleDefaultUserMappingsShouldDiagnostic.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.MultipleDefaultUserMappingsShouldDiagnostic.verified.txt index 7296d18baa..3aef187a7b 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.MultipleDefaultUserMappingsShouldDiagnostic.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.MultipleDefaultUserMappingsShouldDiagnostic.verified.txt @@ -1,14 +1,25 @@ { Diagnostics: [ { - Id: RMG059, - Title: Multiple default user mappings found, only one is allowed, - Severity: Error, - WarningLevel: 0, - Location: : (14,0)-(15,47), - MessageFormat: Multiple default user mappings for the mapping from {0} to {1} found, only one is allowed, + Location: /* + +[UserMapping(Default = true)] +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +public static int IntMapping2(int x) => x + 20; +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +*/ + : (14,0)-(15,47), Message: Multiple default user mappings for the mapping from int to int found, only one is allowed, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG059, + Title: Multiple default user mappings found, only one is allowed, + MessageFormat: Multiple default user mappings for the mapping from {0} to {1} found, only one is allowed, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.UserMappingAttributeOnNonMappingMethod.verified.txt b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.UserMappingAttributeOnNonMappingMethod.verified.txt index 084830bb18..c9be517c02 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.UserMappingAttributeOnNonMappingMethod.verified.txt +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.UserMappingAttributeOnNonMappingMethod.verified.txt @@ -1,14 +1,25 @@ { Diagnostics: [ { - Id: RMG001, - Title: Has an unsupported mapping method signature, - Severity: Error, - WarningLevel: 0, - Location: : (11,4)-(12,47), - MessageFormat: {0} has an unsupported mapping method signature, + Location: /* +{ + [UserMapping] + ^^^^^^^^^^^^^ +public static void NotAMappingMethod2(int s) {} +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +public partial B Map(A s); +*/ + : (11,4)-(12,47), Message: NotAMappingMethod2 has an unsupported mapping method signature, - Category: Mapper + Severity: Error, + Descriptor: { + Id: RMG001, + Title: Has an unsupported mapping method signature, + MessageFormat: {0} has an unsupported mapping method signature, + Category: Mapper, + DefaultSeverity: Error, + IsEnabledByDefault: true + } } ] } \ No newline at end of file