From 86c870d4a10cae606309c019c2d55fbb214d96a6 Mon Sep 17 00:00:00 2001 From: Edward Cooke Date: Fri, 13 Sep 2024 11:52:46 -0600 Subject: [PATCH] Fix warnings when building in linux due to IDE0055 bugs --- YamlDotNet.Test/Yaml.cs | 2 ++ YamlDotNet/Serialization/YamlSerializable.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/YamlDotNet.Test/Yaml.cs b/YamlDotNet.Test/Yaml.cs index 1f9e06f80..79fb06a9d 100644 --- a/YamlDotNet.Test/Yaml.cs +++ b/YamlDotNet.Test/Yaml.cs @@ -108,6 +108,7 @@ public static string Text(string yamlText) } var indentation = indent.Groups[1].Length; +#pragma warning disable IDE0055 // Bug in Linux where IDE0055 is failing on the comments in the inline if statements lines = lines .Select((l, num) => l.Length == 0 ? // Blank lines don't need to be indented. @@ -116,6 +117,7 @@ public static string Text(string yamlText) // However, other lines must be indented at least as much as the first line. throw new ArgumentException($"Incorrectly indented line '{l}', #{num}.", nameof(yamlText)) : l.Substring(indentation)) +#pragma warning restore IDE0055 .ToList(); } diff --git a/YamlDotNet/Serialization/YamlSerializable.cs b/YamlDotNet/Serialization/YamlSerializable.cs index 0eeddede2..cdd5690a8 100644 --- a/YamlDotNet/Serialization/YamlSerializable.cs +++ b/YamlDotNet/Serialization/YamlSerializable.cs @@ -41,9 +41,11 @@ public YamlSerializableAttribute() /// Use this constructor if the attribute is placed on the . /// /// The type for which to include static code generation. +#pragma warning disable IDE0055 // Bug in Linux where IDE0055 is failing on the pragma warning disable IDE0060 #pragma warning disable IDE0060 public YamlSerializableAttribute(Type serializableType) #pragma warning restore IDE0060 +#pragma warning restore IDE0055 { } }