Style fix1 (#512)
* fix SA1505 and SA1508 * fix SA1116 * fix SA1009 * fix SA1019 * fix SA1127 * fix SA1128 * fix SA1134 * fix indent * allow CA2227 * fix CA1810 * using clean up * fix naming * fix CA1806 * fix await * Revert "fix CA1806" This reverts commit a3b465087fdaf26ec461272373ee9810a90de2cc. * fix dotnet format * allow SA1009
This commit is contained in:
@@ -10,10 +10,11 @@ namespace k8s
|
||||
public class StringQuotingEmitter : ChainedEventEmitter
|
||||
{
|
||||
// Patterns from https://yaml.org/spec/1.2/spec.html#id2804356
|
||||
private static readonly Regex quotedRegex =
|
||||
private static readonly Regex QuotedRegex =
|
||||
new Regex(@"^(\~|null|true|false|-?(0|[1-9][0-9]*)(\.[0-9]*)?([eE][-+]?[0-9]+)?)?$");
|
||||
|
||||
public StringQuotingEmitter(IEventEmitter next) : base(next)
|
||||
public StringQuotingEmitter(IEventEmitter next)
|
||||
: base(next)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ namespace k8s
|
||||
break;
|
||||
case TypeCode.String:
|
||||
var val = eventInfo.Source.Value.ToString();
|
||||
if (quotedRegex.IsMatch(val))
|
||||
if (QuotedRegex.IsMatch(val))
|
||||
{
|
||||
eventInfo.Style = ScalarStyle.DoubleQuoted;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user