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

docs(fmt): improve API docs #4829

Merged
merged 10 commits into from
May 28, 2024
Merged

docs(fmt): improve API docs #4829

merged 10 commits into from
May 28, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented May 22, 2024

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
fmt/colors.ts Outdated Show resolved Hide resolved
fmt/colors.ts Outdated Show resolved Hide resolved
@@ -916,11 +916,23 @@ class Printf {
}

/**
* 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
Member

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
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
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

kt3k and others added 2 commits May 23, 2024 13:08
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Copy link

codecov bot commented May 23, 2024

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
38 tasks
fmt/printf.ts Outdated
*
* @param format The format string to use
* @param args The arguments to format
* @returns formatted string
Copy link
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

Copy link
Contributor

@iuioiua iuioiua left a comment

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.

* @example Usage
* ```ts
* import { reset } from "@std/fmt/colors";
* console.log(reset("Hello, world!"));
Copy link
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.

fmt/colors.ts Outdated
Comment on lines 153 to 154
* @param str text to reset
* @returns text with reset color
Copy link
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

@@ -117,23 +143,47 @@ function run(str: string, code: Code): string {

/**
* Reset the text modified.
Copy link
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
12 checks passed
@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