From 4de2ee3c467f6b0d5b6de55edfde709254def671 Mon Sep 17 00:00:00 2001 From: VXNCXNX Date: Fri, 14 Aug 2026 16:28:20 +0000 Subject: [PATCH] fix(dita): report dita's own error output instead of just the exit status lintDITA captured the dita command's stderr into a buffer and never read it, so a failed conversion showed only 'Runtime error / exit status 1' and every diagnostic was discarded. Return the captured stderr, as lintXML already does, falling back to the exit status when dita fails without writing anything. Fixes #578 --- internal/lint/dita.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/lint/dita.go b/internal/lint/dita.go index 124aa658..475966bf 100644 --- a/internal/lint/dita.go +++ b/internal/lint/dita.go @@ -42,6 +42,11 @@ func (l *Linter) lintDITA(file *core.File) error { cmd.Stderr = &out if err = cmd.Run(); err != nil { + // dita's own diagnostics are far more useful than the exit status, + // but it doesn't always write any + if msg := strings.TrimSpace(out.String()); msg != "" { + return core.NewE100(file.Path, errors.New(msg)) + } return core.NewE100(file.Path, err) }