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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃И Tooling: Ensure that all exported functions have a code example #52

Closed
3 tasks done
JoshuaKGoldberg opened this issue Feb 12, 2023 · 5 comments 路 Fixed by #127
Closed
3 tasks done

馃И Tooling: Ensure that all exported functions have a code example #52

JoshuaKGoldberg opened this issue Feb 12, 2023 · 5 comments 路 Fixed by #127
Labels
area: testing Improving how the repository's tests are run and/or code is tested 馃И status: accepting prs Please, send a pull request to resolve this! 馃檹

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

In #5, I filled out a bunch of docs in the README.md: one section for each exported function. But there's nothing enforcing that subsequent PRs don't add more functions without documenting them similarly.

Let's add some kind of unit test that:

  • Imports ts-api-utils
  • Reads in the README.md
  • Ensures that each export from ts-api-utils exists in the README.md

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added area: testing Improving how the repository's tests are run and/or code is tested 馃И status: accepting prs Please, send a pull request to resolve this! 馃檹 labels Feb 12, 2023
@RebeccaStevens
Copy link
Collaborator

Due to the share number of functions exported by this library, I think it would be better to put all these docs in an API.md file rather than cluttering up the readme. The readme can then link to that file. Each of the categories within the API docs could even be split up into sub-files to prevent the API file from becoming huge.

Having a huge readme file can be a bit daunting for new users when they first look at it.

@JoshuaKGoldberg JoshuaKGoldberg changed the title 馃И Testing: Add test that the README.md contains a docs section for every exported function 馃И Testing: Add test that docs contains a section for every exported function Feb 13, 2023
@JoshuaKGoldberg
Copy link
Owner Author

Agreed! Filed #56. We can consider this issue to be about the docs in whatever file(s) contain them.

@RebeccaStevens
Copy link
Collaborator

Can be closed?

@JoshuaKGoldberg JoshuaKGoldberg changed the title 馃И Testing: Add test that docs contains a section for every exported function 馃И Tooling: Ensure that all exported functions have a code example Feb 22, 2023
@JoshuaKGoldberg
Copy link
Owner Author

I do like the idea behind this though - making sure everything has docs. Reworded slightly. WDYT?

@RebeccaStevens
Copy link
Collaborator

I've made a new (WIP) plugin for typedoc to require tags to exists. We can use this to require @example tags exists on all function.

RebeccaStevens/typedoc-plugin-custom-validation#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: testing Improving how the repository's tests are run and/or code is tested 馃И status: accepting prs Please, send a pull request to resolve this! 馃檹
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants