Complete ownership documentation and integration validation
This commit is contained in:
@@ -249,7 +249,7 @@ func runResolution[T any](configuration *T, resolver func(*T, *Resolution) error
|
||||
}
|
||||
}
|
||||
for _, record := range ordered {
|
||||
beforeNode, beforePresent := documentAtPath(decoded.final, record.path)
|
||||
_, beforePresent := documentAtPath(decoded.final, record.path)
|
||||
afterNode, afterPresent := documentAtPath(after, record.path)
|
||||
if !beforePresent && !afterPresent {
|
||||
state.addDiagnostic(CodeResolveInvalidRecord, record.path, "resolution record does not identify an existing or removed value")
|
||||
@@ -258,7 +258,6 @@ func runResolution[T any](configuration *T, resolver func(*T, *Resolution) error
|
||||
if record.helperExpected != nil && (!afterPresent || !configurationValuesEqual(record.helperExpected, afterNode)) {
|
||||
state.addDiagnostic(CodeResolveInvalidTarget, record.path, "resolution helper assignment does not match its declared configuration path")
|
||||
}
|
||||
_ = beforeNode
|
||||
}
|
||||
if hasErrors(state.diagnostics) {
|
||||
return resolutionResult{diagnostics: canonicalDiagnostics(state.diagnostics)}
|
||||
@@ -343,17 +342,3 @@ func clonePaths(paths []Path) []Path {
|
||||
}
|
||||
return cloned
|
||||
}
|
||||
|
||||
func cloneResolutionSnapshots(snapshots []resolutionSnapshot) []resolutionSnapshot {
|
||||
if snapshots == nil {
|
||||
return nil
|
||||
}
|
||||
cloned := make([]resolutionSnapshot, len(snapshots))
|
||||
for index, snapshot := range snapshots {
|
||||
cloned[index] = resolutionSnapshot{
|
||||
change: cloneChange(snapshot.change),
|
||||
before: document.Clone(snapshot.before), after: document.Clone(snapshot.after),
|
||||
}
|
||||
}
|
||||
return cloned
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user