Closing gaps and cleaning house
This commit is contained in:
@@ -1469,11 +1469,10 @@ func validateGeneratedFeatFamilies(dataDir string, report *ValidationReport) {
|
||||
{FamilyKey: "weaponofchoice", Dataset: "baseitems", Column: "WeaponOfChoiceFeat"},
|
||||
}
|
||||
for _, requirement := range required {
|
||||
spec, ok := specs[requirement.FamilyKey]
|
||||
spec, path, ok := generatedFamilySpecByNormalizedKey(specs, specPaths, requirement.FamilyKey)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
path := specPaths[requirement.FamilyKey]
|
||||
if spec.ChildSource.Dataset != requirement.Dataset ||
|
||||
spec.ChildSource.Column != requirement.Column ||
|
||||
spec.ChildSource.Predicate != requirement.Predicate {
|
||||
@@ -1489,6 +1488,20 @@ func validateGeneratedFeatFamilies(dataDir string, report *ValidationReport) {
|
||||
validateRequiredProductionGeneratedFamilies(featDataset.GeneratedDir, specs, report)
|
||||
}
|
||||
|
||||
func generatedFamilySpecByNormalizedKey(specs map[string]familyExpansionSpec, specPaths map[string]string, familyKey string) (familyExpansionSpec, string, bool) {
|
||||
normalized := normalizeKeyIdentity(familyKey)
|
||||
for candidateKey, spec := range specs {
|
||||
if normalizeKeyIdentity(candidateKey) == normalized {
|
||||
path := ""
|
||||
if specPaths != nil {
|
||||
path = specPaths[candidateKey]
|
||||
}
|
||||
return spec, path, true
|
||||
}
|
||||
}
|
||||
return familyExpansionSpec{}, "", false
|
||||
}
|
||||
|
||||
func validateRequiredProductionGeneratedFamilies(path string, specs map[string]familyExpansionSpec, report *ValidationReport) {
|
||||
weaponFamilies := []string{
|
||||
"weaponfocus",
|
||||
@@ -1499,11 +1512,11 @@ func validateRequiredProductionGeneratedFamilies(path string, specs map[string]f
|
||||
"greaterweaponspecialization",
|
||||
}
|
||||
for _, familyKey := range weaponFamilies {
|
||||
if _, ok := specs[familyKey]; !ok {
|
||||
if _, _, ok := generatedFamilySpecByNormalizedKey(specs, nil, familyKey); !ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
if _, ok := specs["weaponofchoice"]; !ok {
|
||||
if _, _, ok := generatedFamilySpecByNormalizedKey(specs, nil, "weaponofchoice"); !ok {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityError,
|
||||
Path: path,
|
||||
@@ -1577,6 +1590,7 @@ func validateGeneratedFeatFamilyCompleteness(path string, spec familyExpansionSp
|
||||
"identity_source": spec.IdentitySource,
|
||||
"allow_existing_only": spec.AllowExistingOnly,
|
||||
"auto_prereq_fields": stringMapToAny(spec.AutoPrereqFields),
|
||||
"legacy_family_keys": validationStringSliceToAny(spec.LegacyFamilyKeys),
|
||||
"child_source": map[string]any{
|
||||
"dataset": spec.ChildSource.Dataset,
|
||||
"column": spec.ChildSource.Column,
|
||||
|
||||
Reference in New Issue
Block a user