fix(docgen): trim trailing space from doc comments

dev
TorchedSammy 2021-12-07 16:57:53 -04:00
parent 3421f286f2
commit 3f1f698511
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 5 additions and 2 deletions

View File

@ -53,7 +53,8 @@ func main() {
mod := l mod := l
if strings.HasPrefix(t.Name, "hl") { mod = "hilbish" } if strings.HasPrefix(t.Name, "hl") { mod = "hilbish" }
if !strings.HasPrefix(t.Name, prefix[mod]) || t.Name == "Loader" { continue } if !strings.HasPrefix(t.Name, prefix[mod]) || t.Name == "Loader" { continue }
parts := strings.Split(t.Doc, "\n") docParts := strings.TrimSpace(t.Doc)
parts := strings.Split(docParts, "\n")
funcsig := parts[0] funcsig := parts[0]
doc := parts[1:] doc := parts[1:]
@ -62,7 +63,9 @@ func main() {
for _, t := range p.Types { for _, t := range p.Types {
for _, m := range t.Methods { for _, m := range t.Methods {
if !strings.HasPrefix(m.Name, prefix[l]) || m.Name == "Loader" { continue } if !strings.HasPrefix(m.Name, prefix[l]) || m.Name == "Loader" { continue }
parts := strings.Split(m.Doc, "\n") // trim extra spaces from the doc
docParts := strings.TrimSpace(m.Doc)
parts := strings.Split(docParts, "\n")
funcsig := parts[0] funcsig := parts[0]
doc := parts[1:] doc := parts[1:]