We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b2f1cd commit 58ad4ffCopy full SHA for 58ad4ff
1 file changed
pkg/mark/ancestry.go
@@ -109,11 +109,15 @@ func ValidateAncestry(
109
}
110
111
if len(page.Ancestors) < len(ancestry) {
112
- return nil, fmt.Errorf(
113
- "page %q has fewer parents than specified: %s",
114
- page.Title,
115
- strings.Join(ancestry, ` > `),
116
- )
+ actual := []string{}
+ for _, ancestor := range page.Ancestors {
+ actual = append(actual, ancestor.Title)
+ }
+
117
+ return nil, karma.Describe("title", page.Title).
118
+ Describe("actual", strings.Join(actual, " > ")).
119
+ Describe("expected", strings.Join(ancestry, ">")).
120
+ Format(nil, "the page has fewer parents than expected")
121
122
123
for _, parent := range ancestry[:len(ancestry)-1] {
0 commit comments