Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken multi-line docstrings in spork/http #197

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

CFiggers
Copy link
Contributor

http contains a number of docstrings that look like they should be long strings but aren't. For example, http/request.

Current output of (doc http/request) at the REPL:

Janet 1.36.0-dev-c82fd106 linux/x64/gcc - '(doc)' for help
repl:1:> (import spork/http)
@{_ @{:value <cycle 0>} http/cookie-grammar @{:private true} http/cookies @{:private true} http/logger @{:private true} http/middleware @{:private true} http/query-string-grammar @{:private true} http/read-body @{:private true} http/read-request @{:private true} http/read-response @{:private true} http/request @{:private true} http/request-peg @{:private true} http/response-peg @{:private true} http/router @{:private true} http/send-response @{:private true} http/server @{:private true} http/server-handler @{:private true} http/status-messages @{:private true} http/url-grammar @{:private true}}
repl:2:> (doc http/request)


    function
    /usr/local/lib/janet/spork/http.janet on line 463, column 1

    (request method url &keys {:headers headers :body body})

    Make an HTTP request to a server. Returns a table containing
    response information.  :head-size - number of bytes in the http
    header  :headers - table mapping header names to header values.
    Header names are lowercase.  :connection - the connection stream
    for the header.  :buffer - the buffer instance that may contain
    extra bytes.  :status - HTTP status code as an integer.  :message -
    HTTP status message.  :body - Bytes of the response body.


nil

Fixed:

Janet 1.36.0-dev-c82fd106 linux/x64/gcc - '(doc)' for help
repl:1:> (import ./spork/http)
@{_ @{:value <cycle 0>} http/cookie-grammar @{:private true} http/cookies @{:private true} http/logger @{:private true} http/middleware @{:private true} http/query-string-grammar @{:private true} http/read-body @{:private true} http/read-request @{:private true} http/read-response @{:private true} http/request @{:private true} http/request-peg @{:private true} http/response-peg @{:private true} http/router @{:private true} http/send-response @{:private true} http/server @{:private true} http/server-handler @{:private true} http/status-messages @{:private true} http/url-grammar @{:private true}}
repl:2:> (doc http/request)


    function
    spork/http.janet on line 463, column 1

    (request method url &keys {:headers headers :body body})

    Make an HTTP request to a server. Returns a table containing
    response information.

    * :head-size - number of bytes in the http header
    * :headers - table mapping header names to header values. Header
      names are lowercase.
    * :connection - the connection stream for the header.
    * :buffer - the buffer instance that may contain extra bytes.
    * :status - HTTP status code as an integer.
    * :message - HTTP status message.
    * :body - Bytes of the response body.


nil

All tests continue to pass.

@sogaiu
Copy link
Contributor

sogaiu commented Sep 11, 2024

LGTM -- much nicer.

Thanks!

@bakpakin bakpakin merged commit 253a67e into janet-lang:master Sep 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants