yaml linter fix & alert sprite specifier changes (#10015)

* Sprite specifier/serializer update

* Immume

* Fix tests

* hooray, more bad test prototypes

* add some comments
This commit is contained in:
Leon Friedrich
2022-07-28 11:17:51 +12:00
committed by GitHub
parent 4fbf8cb349
commit 9020ec6045
8 changed files with 159 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -88,15 +88,28 @@ namespace Content.YAMLLinter
foreach (var (key, val) in serverErrors)
{
// Include all server errors marked as always relevant
var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet();
if (clientErrors.TryGetValue(key, out var clientVal))
{
newErrors.UnionWith(val.Intersect(clientVal));
newErrors.UnionWith(clientVal.Where(n => n.AlwaysRelevant));
}
if (newErrors.Count == 0) continue;
allErrors[key] = newErrors;
// We include sometimes-relevant errors if they exist both for the client & server
if (clientErrors.TryGetValue(key, out var clientVal))
newErrors.UnionWith(val.Intersect(clientVal));
if (newErrors.Count != 0)
allErrors[key] = newErrors;
}
// Finally add any always-relevant client errors.
foreach (var (key, val) in clientErrors)
{
var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet();
if (newErrors.Count == 0)
continue;
if (allErrors.TryGetValue(key, out var errors))
errors.UnionWith(val.Where(n => n.AlwaysRelevant));
else
allErrors[key] = newErrors;
}
return allErrors;