kurtosis-tech / kurtosis-package-indexer

Crawls Github for Kurtosis packages
0 stars 1 forks source link

Newlines are stripped from the response #48

Closed mieubrisse closed 8 months ago

mieubrisse commented 8 months ago

https://kurtosistech.slack.com/archives/C05DZ4UABDZ/p1698675939631249?thread_ts=1698675579.006159&cid=C05DZ4UABDZ

tedim52 commented 8 months ago

I've determined this to be caused by how the package we use to parse docstrings parses the args/fields of the docstring.

When parsing the args of a docstring, docstring removes newline characters "\n" and replaces them with " " as documented here.

// Field represents single "<name>: blah-blah-blah" definition.
type Field struct {
    Name string // name of the field
    Desc string // field's description, "\n" is replaced with " "
}

and

// Join lines by space. We assume argument descriptions do not use newlines
// in a syntax-significant way.
fields = append(fields, Field{
    Name: name,
    Desc: strings.Join(all, " "),
})

One option is to fork the package, adjust this specific behavior, and use our forked package (similar to what we do for stacktrace) but looking for cheaper ways to fix before doing that.

tedim52 commented 8 months ago

Fixed by https://github.com/kurtosis-tech/kurtosis-package-indexer/pull/53