docs: run example snippets that were needlessly excluded from doc tests#7242
Open
tomas-zijdemans wants to merge 2 commits into
Open
docs: run example snippets that were needlessly excluded from doc tests#7242tomas-zijdemans wants to merge 2 commits into
tomas-zijdemans wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7242 +/- ##
==========================================
+ Coverage 95.00% 95.03% +0.02%
==========================================
Files 617 617
Lines 51674 51503 -171
Branches 9326 9283 -43
==========================================
- Hits 49093 48944 -149
+ Misses 2038 2023 -15
+ Partials 543 536 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This PR removes the ignore directive from 111 JSDoc example snippets that type-check, run, and pass as-is. They now execute as doc tests instead of sitting in the docs as dead code.
I audited all 370 ```ts ignore fences in the repo. Most earn their ignore: failing-assertion demos, Deno.serve on fixed ports, BDD examples that can't nest inside a doc test. These 111 don't. They're read-only, deterministic, and local. Things like walk("."), exists() checks, and the 42 console.log-only examples in cli/unstable_ansi.ts. Also resolves the TODO(iuioiua) in async/abortable.ts and async/unstable_abortable.ts, whose examples pass cleanly under --trace-leaks on current Deno.
Note for reviewers: 79 of these snippets don't assert anything, so check_docs.ts flags them once they lose ignore (that's what failed the first lint run here). Those fences are now ```ts no-assert: they still run as doc tests, the checker just knows the missing assertion is intentional. That's the whole diff on those lines.
Deliberately left ignored, for a possible follow-up: