Updated editorconfig to (mostly?) require braces around if/else statements, and applied the new formatting rules

This commit is contained in:
Kwoth
2022-02-02 01:44:45 +01:00
parent b22cd5a81e
commit ffa2c3f119
202 changed files with 2108 additions and 920 deletions

View File

@@ -21,7 +21,10 @@ public class MultilineScalarFlowStyleEmitter : ChainedEventEmitter
{
var isMultiLine = value.IndexOfAny(new[] { '\r', '\n', '\x85', '\x2028', '\x2029' }) >= 0;
if (isMultiLine)
eventInfo = new(eventInfo.Source) { Style = ScalarStyle.Literal };
eventInfo = new(eventInfo.Source)
{
Style = ScalarStyle.Literal
};
}
}

View File

@@ -18,14 +18,16 @@ public class YamlHelper
foreach (var c in point)
{
if (!IsHex(c)) return point;
if (!IsHex(c))
return point;
character = (character << 4) + AsHex(c);
}
// Check the value and write the character.
if (character is (>= 0xD800 and <= 0xDFFF) or > 0x10FFFF) return point;
if (character is (>= 0xD800 and <= 0xDFFF) or > 0x10FFFF)
return point;
return char.ConvertFromUtf32(character);
}
@@ -35,9 +37,11 @@ public class YamlHelper
public static int AsHex(char c)
{
if (c <= '9') return c - '0';
if (c <= '9')
return c - '0';
if (c <= 'F') return c - 'A' + 10;
if (c <= 'F')
return c - 'A' + 10;
return c - 'a' + 10;
}