diff --git a/.globalconfig b/.globalconfig deleted file mode 100644 index bc99cf6..0000000 --- a/.globalconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Global analyzer configuration for ReqStream project -is_global = true - -# Disable S3459 (unassigned auto-property) - False positive for YAML deserializer DTOs -dotnet_diagnostic.S3459.severity = none - -# Disable S1144 (unused private setter) - False positive for YAML deserializer DTOs -dotnet_diagnostic.S1144.severity = none diff --git a/src/DemaConsulting.ReqStream/Requirements.cs b/src/DemaConsulting.ReqStream/Requirements.cs index d1a346a..1bbcd09 100644 --- a/src/DemaConsulting.ReqStream/Requirements.cs +++ b/src/DemaConsulting.ReqStream/Requirements.cs @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +using System.Diagnostics.CodeAnalysis; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; @@ -322,6 +323,9 @@ private void MergeSection(Section target, YamlSection source, string filePath) /// /// Internal class for deserializing the YAML document structure. /// + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] + [SuppressMessage("SonarAnalyzer.CSharp", "S3459:Unassigned members should be removed", Justification = "Properties are set by YamlDotNet deserializer via reflection")] + [SuppressMessage("SonarAnalyzer.CSharp", "S1144:Unused private types or members should be removed", Justification = "Properties are accessed by YamlDotNet deserializer via reflection")] private sealed class YamlDocument { /// @@ -343,6 +347,9 @@ private sealed class YamlDocument /// /// Internal class for deserializing a YAML section. /// + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] + [SuppressMessage("SonarAnalyzer.CSharp", "S3459:Unassigned members should be removed", Justification = "Properties are set by YamlDotNet deserializer via reflection")] + [SuppressMessage("SonarAnalyzer.CSharp", "S1144:Unused private types or members should be removed", Justification = "Properties are accessed by YamlDotNet deserializer via reflection")] private sealed class YamlSection { /// @@ -364,6 +371,9 @@ private sealed class YamlSection /// /// Internal class for deserializing a YAML requirement. /// + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] + [SuppressMessage("SonarAnalyzer.CSharp", "S3459:Unassigned members should be removed", Justification = "Properties are set by YamlDotNet deserializer via reflection")] + [SuppressMessage("SonarAnalyzer.CSharp", "S1144:Unused private types or members should be removed", Justification = "Properties are accessed by YamlDotNet deserializer via reflection")] private sealed class YamlRequirement { /// @@ -390,6 +400,9 @@ private sealed class YamlRequirement /// /// Internal class for deserializing a YAML test mapping. /// + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] + [SuppressMessage("SonarAnalyzer.CSharp", "S3459:Unassigned members should be removed", Justification = "Properties are set by YamlDotNet deserializer via reflection")] + [SuppressMessage("SonarAnalyzer.CSharp", "S1144:Unused private types or members should be removed", Justification = "Properties are accessed by YamlDotNet deserializer via reflection")] private sealed class YamlMapping { ///