Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings when building in linux due to IDE0055 bugs #978

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions YamlDotNet.Test/Yaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
}

Expand Down
2 changes: 2 additions & 0 deletions YamlDotNet/Serialization/YamlSerializable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ public YamlSerializableAttribute()
/// Use this constructor if the attribute is placed on the <see cref="StaticContext"/>.
/// </summary>
/// <param name="serializableType">The type for which to include static code generation.</param>
#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
{
}
}
Expand Down