-
Notifications
You must be signed in to change notification settings - Fork 156
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
Correct + make runnable documentation code samples. #1396
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1396 +/- ##
==========================================
- Coverage 95.65% 93.11% -2.55%
==========================================
Files 19 17 -2
Lines 10897 10888 -9
Branches 1730 1633 -97
==========================================
- Hits 10424 10138 -286
- Misses 469 740 +271
- Partials 4 10 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I'm so glad this could be semi-automated!
Long pull request, so long review comments. But most are minor.
Oops, I forgot about this one a while back, sorry for dropping the ball there. Finished the last changes and re-ran everything to catch a few more fixes in rebasing. I changed every representation to the Node REPL version, which had some annoying effects (lots of 'Temporal.TypeName ' rather than just 'string repr') but overall I think it's more clear and not too bad. One thing that I had mixed feelings about was using the |
Thanks for updating this. I don't think the I think it's fine to have Otherwise looks good. |
Pushed as two additional commits for easier re-review, will squash before merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All minor things, feel free to merge after addressing.
docs/duration.md
Outdated
Usage examples: | ||
|
||
TODO FIXME CURRENTLY NOT SPECIFIED, should we remove? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's clear from the note above that DurationFormat is still early stage, and so instead we should just note that the output of the code below is only example output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, here I thought if I left a big TODO FIXME I'd surely catch it before review, then forgot about it before pushing. I should really install my pre-push hook!
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear.
Common classes of smaller issues fixed:
Though the documentation tester I wrote isn't included in this patch, because it's messy, one-off, and would be needless work to maintain for auditing every pull request, I'll keep it around for periodic audits of the documentation.
Fixes #921 .