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: fix typos in docs, comments, and tests #596

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Oct 3, 2024

The PR corrects grammar mistakes in words.

Summary by CodeRabbit

Release Notes

  • Documentation Enhancements

    • Improved clarity and detail in the Service CLI documentation, including input options and custom commands.
    • Updated request inputs documentation with a comprehensive overview of parameters and their types.
    • Refined request validation documentation for better understanding of struct tags and validation rules.
    • Enhanced schema customization documentation with clearer examples and explanations.
    • Clarified OAuth 2.0 authorization setup for APIs, detailing token issuance and middleware usage.
  • Bug Fixes

    • Corrected typographical errors in various documentation and test comments for improved clarity.

Copy link

coderabbitai bot commented Oct 3, 2024

Walkthrough

The changes in this pull request include minor corrections to comments in various test files and documentation. Specifically, typos were fixed in comments and documentation across multiple files, enhancing clarity without altering any functionality. The documentation updates provide detailed explanations regarding the Service CLI, request inputs, request validation, schema customization, and OAuth 2.0 setup, ensuring users have accurate and comprehensive guidance.

Changes

File Change Summary
adapters/humaflow/flow/flow_test.go Corrected comment from // wilcards to // wildcards in TestMatching function.
docs/docs/features/cli.md Updated CLI documentation with detailed explanations, examples, and minor corrections.
docs/docs/features/request-inputs.md Clarified usage of parameters, added examples, and refined explanations regarding request bodies.
docs/docs/features/request-validation.md Corrected typographical errors and clarified documentation regarding optional/required fields.
docs/docs/features/schema-customization.md Enhanced explanations of JSON Schema customization, added examples, and corrected typographical errors.
docs/docs/how-to/oauth2-jwt.md Improved clarity of OAuth 2.0 setup documentation, refined sections, and adjusted examples.
humacli/humacli_test.go Corrected field name from ingore to ignore in Options struct within TestCLIPlain function.
openapi.go Updated comment from "supercedes" to "supersedes" for BodyReadTimeout field in Operation struct.
schema.go Corrected typographical errors in comments related to JSON Schema types.
sse/sse_test.go Corrected comment from "doens't" to "doesn't" in TestSSE function.

Possibly related PRs

  • Fix typo in request-inputs.md #591: Fix typo in request-inputs.md - This PR addresses a typographical error in the documentation, similar to the comment correction made in the main PR's test file, indicating a focus on improving clarity in documentation.

Suggested reviewers

  • danielgtaylor

Poem

🐰 In the land of code where comments roam,
Typos corrected, clarity found a home.
With every fix, our docs shine bright,
Guiding the users, making things right.
Hooray for the changes, let’s hop with glee,
For a clearer tomorrow, as bright as can be! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
docs/docs/features/schema-customization.md (3)

55-55: Approved: Improved explanation of huma.Registry

The added explanation provides valuable context for the huma.Registry parameter. The link to the documentation is correct and helpful.

Consider adding a brief explanation of what a Registry does in this context, e.g., "The Registry is responsible for generating and storing JSON Schemas for types in your API."


Line range hint 55-93: Approved: Well-documented OmittableNullable struct and methods

The addition of the OmittableNullable struct and its methods is well-documented and provides a clear example of custom schema implementation. The code is correct and the explanations are helpful.

Consider adding a brief comment in the Schema method to explain why it's using reflect.TypeOf(o.Value) instead of T. This might help readers understand the relationship between the generic type T and the schema generation process.


Line range hint 95-124: Approved: Clear example of OmittableNullable usage

The added example operation effectively demonstrates how to use the OmittableNullable struct in practice. It clearly shows how to handle different states of the field (omitted, null, or set to a value).

Consider adding a brief note about how this approach compares to using a pointer to a string (*string). This could help readers understand when to use OmittableNullable over simpler nullable types.

humacli/humacli_test.go (1)

83-83: Assertion added for the corrected field.

The addition of assert.False(t, options.ignore) is consistent with the struct field name correction and ensures that the ignore field is being properly tested.

Consider adding a brief comment explaining the purpose of this assertion, for example:

// Ensure the 'ignore' field is false by default
assert.False(t, options.ignore)
docs/docs/features/cli.md (1)

158-158: Use fenced code block style for consistency

To maintain consistency with the rest of the document and address the Markdownlint warning, consider changing the info block to use fenced code block style.

Here's the suggested change:

-    You can also overwrite `cli.Root().Run` to completely customize how you run the server. Or just ditch the `cli` package altogether!
+```
+You can also overwrite `cli.Root().Run` to completely customize how you run the server. Or just ditch the `cli` package altogether!
+```
🧰 Tools
🪛 Markdownlint

158-158: Expected: fenced; Actual: indented
Code block style

(MD046, code-block-style)

docs/docs/features/request-inputs.md (2)

36-36: Great clarification on query parameter handling!

The added information about specifying query parameters multiple times and the explanation of the 'explode' tag significantly improves the documentation. The performance recommendation for using comma-separated lists is particularly valuable.

Consider adding a brief example of how to use the 'explode' tag in the struct definition for even more clarity. For instance:

type MyInput struct {
    Tags []string `query:"tags,explode"`
}

Line range hint 101-140: Great addition of Multipart Form Data section!

The new section explaining support for multipart form data, including the example of how to use RawBody with the multipart.Form type, is a valuable addition to the documentation. This covers an important use case for file uploads that was previously not documented.

Consider adding a brief note or example on how to access the uploaded files from the multipart.Form. For instance:

file, header, err := input.RawBody.File["fieldname"]
if err != nil {
    // Handle error
}
// Use file and header as needed

This would provide a complete picture of how to handle file uploads using this method.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6e119e8 and 6116f49.

📒 Files selected for processing (10)
  • adapters/humaflow/flow/flow_test.go (1 hunks)
  • docs/docs/features/cli.md (1 hunks)
  • docs/docs/features/request-inputs.md (1 hunks)
  • docs/docs/features/request-validation.md (2 hunks)
  • docs/docs/features/schema-customization.md (1 hunks)
  • docs/docs/how-to/oauth2-jwt.md (1 hunks)
  • humacli/humacli_test.go (1 hunks)
  • openapi.go (1 hunks)
  • schema.go (2 hunks)
  • sse/sse_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • adapters/humaflow/flow/flow_test.go
  • docs/docs/features/request-validation.md
  • openapi.go
  • schema.go
  • sse/sse_test.go
🧰 Additional context used
🪛 LanguageTool
docs/docs/features/cli.md

[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...

(EN_EXCESSIVE_EXCLAMATION)

🪛 Markdownlint
docs/docs/features/cli.md

158-158: Expected: fenced; Actual: indented
Code block style

(MD046, code-block-style)

🔇 Additional comments (10)
docs/docs/features/schema-customization.md (1)

Line range hint 1-134: Overall: Excellent improvements to schema customization documentation

The changes in this file significantly enhance the clarity and completeness of the schema customization documentation. The added examples, particularly the OmittableNullable struct and its usage, provide valuable insights into advanced schema customization techniques. These improvements align well with the PR objective of fixing typos and enhancing documentation quality.

Great work on improving this documentation! The changes will undoubtedly help users better understand and implement custom schemas in the Huma framework.

humacli/humacli_test.go (2)

76-83: Overall assessment: Changes improve code quality and align with PR objectives.

The corrections made in this file successfully address the typo issue, improving both the struct definition and the corresponding test assertion. These changes align well with the PR's objective of fixing typos in tests. The modifications enhance code readability and ensure proper testing of the ignore field.


76-76: Typo correction approved.

The change from ingore to ignore in the Options struct is correct and aligns with the PR objective of fixing typos. This improves code readability and maintains consistency with standard English spelling.

To ensure all instances of this typo have been addressed, please run the following command:

docs/docs/features/cli.md (2)

154-157: LGTM: Clear explanation of custom options usage

The explanation of how to access custom options in custom commands is clear and concise. The introduction of the huma.WithOptions utility function is well-documented and provides valuable information for users.

🧰 Tools
🪛 LanguageTool

[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...

(EN_EXCESSIVE_EXCLAMATION)


Line range hint 1-193: LGTM: Well-structured and informative documentation

The documentation for the Service CLI is well-organized, clear, and informative. It provides comprehensive coverage of the feature's functionality and usage.

Note: The LanguageTool warning about excessive exclamation marks on line 155 is a false positive. The "!!!" is used for creating an info block in Markdown and is not actual exclamation marks in the text.

🧰 Tools
🪛 LanguageTool

[style] ~155-~155: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 3958 characters long)
Context: ...available before running your command. !!! info "More Customization" You can ...

(EN_EXCESSIVE_EXCLAMATION)

🪛 Markdownlint

158-158: Expected: fenced; Actual: indented
Code block style

(MD046, code-block-style)

docs/docs/features/request-inputs.md (3)

Line range hint 1-35: Excellent improvements to the Parameters section!

The addition of the table listing available tags with their descriptions and examples greatly enhances the clarity and usability of the documentation. The info box about the 'required' tag is a valuable addition, emphasizing important usage guidelines.


Line range hint 37-100: Excellent addition of special types information!

The new table listing special types supported for request bodies, along with their schemas and examples, is a valuable addition to the documentation. This information will be extremely helpful for developers working with various data types in their API requests.


Line range hint 1-140: Overall excellent improvements to the documentation!

The changes made to this file significantly enhance the quality and completeness of the documentation for request inputs. The additions and clarifications provide developers with a more comprehensive understanding of how to work with various input types, including parameters, request bodies, and multipart form data. These improvements will undoubtedly make it easier for developers to effectively use the API and implement various features.

Great job on these documentation updates!

docs/docs/how-to/oauth2-jwt.md (2)

113-113: Improved clarity in API Gateway section

The modification enhances the readability of the sentence without altering its meaning. This change aligns well with the PR's objective of improving documentation clarity.


Line range hint 1-113: Overall document review

The changes in this document are minimal and focused on improving clarity, which aligns well with the PR objectives of fixing typos and enhancing documentation. The overall structure and content of the document remain consistent with its original purpose of explaining OAuth2.0 authorization setup for APIs using Huma.

🧰 Tools
🪛 Markdownlint

110-110: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Copy link
Owner

@danielgtaylor danielgtaylor left a comment

Choose a reason for hiding this comment

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

Thanks! ❤️

@danielgtaylor danielgtaylor merged commit 4866d9c into danielgtaylor:main Oct 4, 2024
3 checks passed
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.80%. Comparing base (6e119e8) to head (6116f49).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #596   +/-   ##
=======================================
  Coverage   92.80%   92.80%           
=======================================
  Files          22       22           
  Lines        3903     3903           
=======================================
  Hits         3622     3622           
  Misses        236      236           
  Partials       45       45           

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants