Skip to content

docs(fmt): improve API docs - #4829

Merged
kt3k merged 10 commits into
denoland:mainfrom
kt3k:document-fmt
May 28, 2024
Merged

kt3k merged 10 commits into
denoland:mainfrom
kt3k:document-fmt

Conversation

@kt3k

@kt3k kt3k commented May 22, 2024

Copy link
Copy Markdown
Contributor

part of #3764

@github-actions github-actions Bot added the fmt label May 22, 2024
@kt3k
kt3k requested a review from magurotuna May 22, 2024 10:16
Comment thread fmt/colors.ts Resolved
Comment thread fmt/colors.ts Resolved
Comment thread fmt/printf.ts

/**
* Converts and format a variable number of `args` as is specified by `format`.
* Converts and formats a variable number of `args` as is specified by `format`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mention that users should look at the printf module level doc to view what format strings are supported.

@crowlKats we should really have some way to link to module level docs with @link

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lucacasonato I can look into it on friday

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to wait until we can link to the module level doc before this PR lands? I think other than that the PR looks good to me

@codecov

codecov Bot commented May 23, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.35%. Comparing base (f065c99) to head (dc58e42).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4829   +/-   ##
=======================================
  Coverage   92.35%   92.35%           
=======================================
  Files         488      488           
  Lines       41580    41581    +1     
  Branches     5405     5405           
=======================================
+ Hits        38402    38403    +1     
  Misses       3122     3122           
  Partials       56       56           

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

@kt3k kt3k mentioned this pull request May 23, 2024
37 of 38 tasks
Comment thread fmt/printf.ts Outdated
*
* @param format The format string to use
* @param args The arguments to format
* @returns formatted string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: in other places of @returns tag the sentences start with The, but here it doesn't

@iuioiua iuioiua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some nits. Otherwise, LGTM! Good to see this done.

Comment thread fmt/colors.ts
* @example Usage
* ```ts
* import { reset } from "@std/fmt/colors";
* console.log(reset("Hello, world!"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking nit: I think we should have at least one empty line between imports and the rest of the code, for readability. Ditto elsewhere.

Comment thread fmt/colors.ts Outdated
Comment on lines +153 to +154
* @param str text to reset
* @returns text with reset color

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: We should use proper casing. Ditto elsewhere.

Suggested change
* @param str text to reset
* @returns text with reset color
* @param str Text to reset
* @returns Text with reset color

Comment thread fmt/colors.ts
@@ -117,23 +143,47 @@ function run(str: string, code: Code): string {

/**
* Reset the text modified.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should use "printed text" in the JSDocs for these descriptions and in tags. Such emphasis might be valuable to beginners.

@kt3k
kt3k merged commit 1eaee14 into denoland:main May 28, 2024
@kt3k
kt3k deleted the document-fmt branch May 28, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants