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

chore: improve doc checker #4782

Merged
merged 4 commits into from
May 21, 2024
Merged

chore: improve doc checker #4782

merged 4 commits into from
May 21, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented May 21, 2024

This PR:

  1. Swaps the command order in the lint:docs task so document.jsDoc is known to be defined in the doc checker.
  2. Simplifies some of the functions in the doc checker by just passing in document.
  3. Adds the ability for the doc checker to check if the JSDocs for exported variables contain at least one example.

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.88%. Comparing base (c816314) to head (c13286c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4782      +/-   ##
==========================================
- Coverage   91.88%   91.88%   -0.01%     
==========================================
  Files         486      486              
  Lines       41340    41339       -1     
  Branches     5325     5325              
==========================================
- Hits        37987    37986       -1     
  Misses       3296     3296              
  Partials       57       57              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -19,7 +19,7 @@
"lint:circular": "deno run --allow-env --allow-read --allow-net=deno.land,jsr.io ./_tools/check_circular_package_dependencies.ts",
"lint:mod-exports": "deno run --allow-env --allow-read ./_tools/check_mod_exports.ts",
"lint:tools-types": "deno check _tools/*.ts",
"lint:docs": "deno run -A _tools/check_docs.ts && deno doc --lint collections/mod.ts bytes/mod.ts datetime/mod.ts internal/mod.ts media_types/mod.ts url/mod.ts",
"lint:docs": "deno doc --lint collections/mod.ts bytes/mod.ts datetime/mod.ts internal/mod.ts media_types/mod.ts url/mod.ts && deno run -A _tools/check_docs.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By swapping the order of commands, we know that document.jsDoc is defined.

@iuioiua iuioiua marked this pull request as ready for review May 21, 2024 00:32
@iuioiua iuioiua requested a review from kt3k as a code owner May 21, 2024 00:32
@iuioiua
Copy link
Contributor Author

iuioiua commented May 21, 2024

On second thought, do we want to check that even variables have examples?

@kt3k
Copy link
Member

kt3k commented May 21, 2024

On second thought, do we want to check that even variables have examples?

hmm, I don't think every variable needs examples..

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iuioiua iuioiua merged commit 16162eb into main May 21, 2024
12 checks passed
@iuioiua iuioiua deleted the doc-check-variable branch May 21, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants