Repository navigation
trim stdlib comments - #128
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stdlib's comments, cut down, and every file run through
scarlet fmt.Comments: 3,052 lines → 1,046. The rule applied throughout: a comment earns its place by saying something the code cannot — a non-obvious why, an RFC rule that matters, a trap. What a name or a signature already said is gone, along with history notes ("used to", "the old VM", issue numbers) and
// ---------- banners ----------. What is left is at most three lines, and a module's own doc at most ten.The biggest cuts:
wire.scrl304 → 18,process.scrl366 → 115,http.scrl268 → 92,json/decode.scrl216 → 53,http/client.scrl204 → 72.docs/wire-format.mdis new.wire.scrlwas 304 comment lines of 319, and most of it was the byte format: tags, layouts, the capture format, the fingerprint, the order refusals are checked in. Wire is not built on the new VM yet, and whoever rebuilds it will want that — so it moved to a doc, as tables and short prose, and the module doc points at it.Formatting. All 40 files now pass
scarlet fmt --check; 17 did not. A test inmodule/stdlib.rskeeps it that way: people read the stdlib to learn how Scarlet is written, so it should look like what the formatter produces. The two formatter fixes this turned up went in ahead of it (#126, #127).Three imports nothing used are gone:
intfromhttp/form,resultfromjson,optionfromoauth2.Nothing else changed. Stripping comments and blank lines from every file, before and after, gives the same code apart from those three imports — and formatting only rewraps. One test in
references.rspinned a line number inarray.scrl; it now reads the line out of the file, so editing a comment can never fail it for the wrong reason.Not done here:
examples/andtests/programs/are still unformatted, and their comments are untouched.All seven CI gates pass locally. hawk ran for the host target, and nothing here is gated on a cfg.