From c0920494efdd52345c6efdc4a0c021c9b4e5da64 Mon Sep 17 00:00:00 2001 From: Todd Lucas Date: Wed, 12 Apr 2023 08:32:37 -0700 Subject: [PATCH] fix: add target type to the RMG012 diagnostic (#310) RMG023 was also updated to include the target type, due to the way the message is invoked alongside RMG012. The message format of RMG012 was updated to follow the format of RMG020. --- src/Riok.Mapperly/AnalyzerReleases.Shipped.md | 2 +- .../NewInstanceObjectPropertyMappingBodyBuilder.cs | 3 +++ .../ObjectPropertyMappingBodyBuilder.cs | 1 + .../Diagnostics/DiagnosticDescriptors.cs | 6 +++--- .../Mapping/ObjectPropertyIgnoreTest.cs | 4 ++-- .../Mapping/ObjectPropertyInitPropertyTest.cs | 2 +- ...tFoundSourcePropertyShouldDiagnostic.verified.txt | 6 +++--- ...opertySourceNotFoundShouldDiagnostic.verified.txt | 4 ++-- ...tFoundTargetPropertyShouldDiagnostic.verified.txt | 6 +++--- ...ertyNameMappingStrategyCaseSensitive.verified.txt | 6 +++--- ...ithUnmatchedPropertyShouldDiagnostic.verified.txt | 6 +++--- ...t.ManuallyMappedPropertiesShouldWork.verified.txt | 12 ++++++------ 12 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/Riok.Mapperly/AnalyzerReleases.Shipped.md b/src/Riok.Mapperly/AnalyzerReleases.Shipped.md index b5f875ed42..ebc41f8e18 100644 --- a/src/Riok.Mapperly/AnalyzerReleases.Shipped.md +++ b/src/Riok.Mapperly/AnalyzerReleases.Shipped.md @@ -15,7 +15,7 @@ RMG008 | Mapper | Error | Could not create mapping. RMG009 | Mapper | Info | Cannot map to read only property. RMG010 | Mapper | Info | Cannot map from write only property. RMG011 | Mapper | Info | Cannot map to write only property path. -RMG012 | Mapper | Info | Mapping source property not found. +RMG012 | Mapper | Info | Source property was not found for target property RMG013 | Mapper | Error | No accessible constructor with mappable arguments found RMG014 | Mapper | Warning | Cannot map to the configured constructor to be used by Mapperly RMG015 | Mapper | Info | Cannot map to init only property path diff --git a/src/Riok.Mapperly/Descriptors/MappingBodyBuilders/NewInstanceObjectPropertyMappingBodyBuilder.cs b/src/Riok.Mapperly/Descriptors/MappingBodyBuilders/NewInstanceObjectPropertyMappingBodyBuilder.cs index d5618e75c6..659dcd2162 100644 --- a/src/Riok.Mapperly/Descriptors/MappingBodyBuilders/NewInstanceObjectPropertyMappingBodyBuilder.cs +++ b/src/Riok.Mapperly/Descriptors/MappingBodyBuilders/NewInstanceObjectPropertyMappingBodyBuilder.cs @@ -56,6 +56,7 @@ private static void BuildInitOnlyPropertyMappings(INewInstanceBuilderContext