Delete dead runtime projection reflection caches
This commit is contained in:
parent
5d7f0ef9b2
commit
7ed5b4d7db
3 changed files with 41 additions and 96 deletions
|
|
@ -32,6 +32,7 @@ RequireMainMenuSettingsCommit(root);
|
|||
RequirePlayerSettingsEveSurface(root);
|
||||
RequireMainMenuContinueRunState(root);
|
||||
RequirePropertiesPanelReadOnlyInspector(root);
|
||||
RequireNoDeadRuntimeProjectionCaches(root);
|
||||
RequireRuntimeSimulationTuningCommits(root);
|
||||
RequireHullConductivityCommitAuthority(root);
|
||||
RequireInventoryEntityRenameCommitAuthority(root);
|
||||
|
|
@ -869,6 +870,41 @@ static void RequireTypedBehaviorBodyKeys(string root)
|
|||
}
|
||||
}
|
||||
|
||||
static void RequireNoDeadRuntimeProjectionCaches(string root)
|
||||
{
|
||||
var path = Path.Combine(root, "Assets", "Scripts", "ServerShared", "RuntimeProjection", "ReflectionExtensions.cs");
|
||||
if (!File.Exists(path))
|
||||
return;
|
||||
|
||||
var forbiddenSymbols = new[]
|
||||
{
|
||||
"GetAllInterfaceClasses(",
|
||||
"GetParentTypes(",
|
||||
"GetAllChildClasses(",
|
||||
"GetAllGenericChildClasses(",
|
||||
"IsAssignableToGenericType(",
|
||||
"GetFullName(",
|
||||
"InterfaceClasses",
|
||||
"ParentTypes",
|
||||
"ChildClasses",
|
||||
"GenericChildClasses",
|
||||
"AppDomain.CurrentDomain.GetAssemblies()"
|
||||
};
|
||||
|
||||
var hits = File.ReadLines(path)
|
||||
.Select((line, index) => new { Line = line, LineNumber = index + 1 })
|
||||
.Where(line => forbiddenSymbols.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal)))
|
||||
.Select(line => $"Assets/Scripts/ServerShared/RuntimeProjection/ReflectionExtensions.cs:{line.LineNumber}: {line.Line.Trim()}")
|
||||
.ToArray();
|
||||
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Dead runtime-projection reflection caches should stay deleted; keep only the live string-formatting helpers: " +
|
||||
string.Join("; ", hits));
|
||||
}
|
||||
}
|
||||
|
||||
static void RequireTypedOrbitTaskKeys(string root)
|
||||
{
|
||||
var checkedFiles = new[]
|
||||
|
|
|
|||
Loading…
Reference in a new issue