mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Updated editorconfig to (mostly?) require braces around if/else statements, and applied the new formatting rules
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user