Format declaration paths only for issues

This commit is contained in:
2026-11-07 15:56:25 +00:00
parent 83386217db
commit 0a81be84f6
3 changed files with 15 additions and 4 deletions

View File

@@ -453,8 +453,11 @@ func collectDeclarationIssues(command Command, parents []string, root bool, issu
return
}
record := command.record
path := append(append([]string(nil), parents...), record.name)
label := commandpath.FromTokens(path).String()
path := append(parents, record.name)
var label string
if len(record.issues) > 0 || (record.rootOnly && !root) {
label = commandpath.Path(path).String()
}
for _, issue := range record.issues {
if label != "" {
*issues = append(*issues, fmt.Errorf("command %q: %w", label, issue))