Explicit masterfeats/feats removal
This commit is contained in:
@@ -456,20 +456,7 @@ func validateDataObject(path string, obj map[string]any, report *ValidationRepor
|
||||
|
||||
func validateMasterfeatsBaseFile(path string, obj map[string]any, report *ValidationReport) {
|
||||
validateRowsFile(path, obj, report, true)
|
||||
|
||||
if output, ok := obj["output"]; !ok {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityError,
|
||||
Path: path,
|
||||
Message: "masterfeats base.json must contain output set to masterfeats.2da",
|
||||
})
|
||||
} else if outputText, ok := output.(string); !ok || strings.TrimSpace(outputText) != "masterfeats.2da" {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityError,
|
||||
Path: path,
|
||||
Message: "masterfeats output must be masterfeats.2da",
|
||||
})
|
||||
}
|
||||
validateDerivedBaseOutput(path, obj, "masterfeats", report)
|
||||
|
||||
columns := extractValidationColumns(obj)
|
||||
for _, required := range []string{"LABEL", "STRREF", "DESCRIPTION"} {
|
||||
@@ -520,18 +507,17 @@ func validateMasterfeatsLockFile(path string, obj map[string]any, report *Valida
|
||||
|
||||
func validateFeatBaseFile(path string, obj map[string]any, report *ValidationReport) {
|
||||
validateRowsFile(path, obj, report, true)
|
||||
validateDerivedBaseOutput(path, obj, "feat", report)
|
||||
}
|
||||
|
||||
func validateDerivedBaseOutput(path string, obj map[string]any, datasetLabel string, report *ValidationReport) {
|
||||
if output, ok := obj["output"]; !ok {
|
||||
return
|
||||
} else if outputText, ok := output.(string); !ok || strings.TrimSpace(outputText) != nativeDatasetDefaultOutputName(filepath.Dir(path), nativeDatasetBase) {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityError,
|
||||
Path: path,
|
||||
Message: "feat base.json must contain output set to feat.2da",
|
||||
})
|
||||
} else if outputText, ok := output.(string); !ok || strings.TrimSpace(outputText) != "feat.2da" {
|
||||
report.Diagnostics = append(report.Diagnostics, Diagnostic{
|
||||
Severity: SeverityError,
|
||||
Path: path,
|
||||
Message: "feat output must be feat.2da",
|
||||
Message: fmt.Sprintf("%s output must be %s", datasetLabel, nativeDatasetDefaultOutputName(filepath.Dir(path), nativeDatasetBase)),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user