Skip to content

docs: update docs for v0.21 #151

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

Merged
merged 4 commits into from
Apr 30, 2025
Merged

docs: update docs for v0.21 #151

merged 4 commits into from
Apr 30, 2025

Conversation

Oudwins
Copy link
Owner

@Oudwins Oudwins commented Apr 28, 2025

Summary by CodeRabbit

  • Documentation
    • Updated and clarified documentation across multiple sections to simplify transformation concepts, unify pre- and post-transform methods into a single transform mechanism, and improve code examples for data parsing and custom tests.
    • Added a new section explaining preprocessing functions and introduced clearer usage of preprocessing and transformation functions.
    • Revised and modernized example code and terminology for better clarity and consistency.
    • Updated schema method references, removed outdated examples, refined explanations of validation and parsing workflows, and clarified error handling behavior.

Copy link
Contributor

coderabbitai bot commented Apr 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The documentation and README were updated to unify and simplify the explanation of data transformations in the Zog validation library. The distinction between pre- and post-transforms was removed in favor of a single, generic Transform mechanism, and new examples illustrate using z.Preprocess for input preprocessing. Method names and type signatures for custom tests and transforms were clarified, with improved emphasis on pointer usage and type safety. Several sections were reworded or reorganized for clarity, and new documentation was added to explain pretransforms. Outdated or redundant examples and explanations were removed or replaced.

Changes

File(s) Change Summary
README.md, docs/docs/getting-started.md Updated transformation example to use z.Preprocess and a unified schema, removed explicit post-transform, and modernized comments and section titles.
docs/docs/core-concepts/1-anatomy-of-schema.md, docs/docs/reference.md Removed separate pre/post-transform concepts, introduced a generic Transform method, updated examples and type signatures, and clarified transform application order.
docs/docs/preprocess.md Added new documentation section explaining pretransforms, their usage, function signature, and caveats.
docs/docs/core-concepts/3-parsing.mdx Replaced detailed parsing step enumeration with a concise summary of the parsing process and repositioned the workflow image.
docs/docs/core-concepts/parsing-table.tsx Changed requiredError from "yes" to "no" for empty string and space string values in several schema types.
docs/docs/changes-from-zod.md Clarified renaming of Zod's refine and superRefine methods to Zog's schema.TestFunc and schema.Test().
docs/docs/core-design-decisions.md Removed details about the DataProvider interface, changed terminology from PreTransform/PostTransform to Preprocess/Transform, and updated the list of unsupported schemas.
docs/docs/custom-tests.md Updated custom test examples to use explicit pointer types, clarified type assertions, and adjusted function signatures for reusable tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ZogSchema
    participant PreprocessFunc
    participant TransformFunc
    participant Validator

    User->>ZogSchema: Parse(input)
    ZogSchema->>PreprocessFunc: Preprocess(input)
    PreprocessFunc-->>ZogSchema: PreprocessedData
    ZogSchema->>TransformFunc: Transform(PreprocessedData)
    TransformFunc-->>ZogSchema: TransformedData
    ZogSchema->>Validator: Validate(TransformedData)
    Validator-->>ZogSchema: ValidationResult
    ZogSchema-->>User: Result or Errors
Loading

Possibly related PRs

  • docs: update docs for v0.21 #151: Identical updates to documentation replacing separate pre- and post-transform examples with a unified z.Preprocess and Transform approach, clarifying schema transformation usage.

Poem

In the docs, the schemas now gleam,
Transforms united—no more pre/post-team!
Preprocess splits, trims, and clears,
While pointers and types bring fewer fears.
With Zog, your data flows neat and bright,
A rabbit’s hop to validation done right!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 394e599 and 7307920.

📒 Files selected for processing (3)
  • docs/docs/custom-tests.md (4 hunks)
  • docs/docs/preprocess.md (1 hunks)
  • docs/docs/reference.md (3 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

cloudflare-workers-and-pages bot commented Apr 28, 2025

Deploying zog with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7307920
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@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: 4

🧹 Nitpick comments (14)
docs/docs/changes-from-zod.md (1)

15-15: Grammar refinement for methods rename: Since you refer to multiple methods, use the plural verb “are renamed” instead of “is renamed.” For example:

- The refine & superRefine methods for providing a custom validation function is renamed to `schema.TestFunc` & `schema.Test()`
+ The refine & superRefine methods for providing a custom validation function are renamed to `schema.TestFunc` & `schema.Test()`
docs/docs/core-design-decisions.md (1)

12-12: Grammar refinement for clarity: Consider adding a comma after “For more on this see Errors” and ending the sentence with a period. For example:

- For more on this see [Errors](/errors)
+ For more on this, see [Errors](/errors).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~12-~12: Possible missing comma found.
Context: ...raps around an error and adds a message field which is text that can be shown to the ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~12-~12: Possible missing comma found.
Context: ...t can be shown to the user. For more on this see Errors - You should not ...

(AI_HYDRA_LEO_MISSING_COMMA)

README.md (1)

154-161: Include import for strings package.
To make the example self-contained, add:

import "strings"

before using strings.Split in the z.Preprocess snippet.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

159-159: Hard tabs
Column: 1

(MD010, no-hard-tabs)


160-160: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/preprocess.md (3)

8-9: Specify package qualifier for Ctx.
In the signature, change func(data any, ctx Ctx) to func(data any, ctx z.Ctx) to match other examples and avoid ambiguity.


14-17: Replace hard tabs with spaces.
Markdown linting flags hard tabs; convert them to spaces in the code block to satisfy MD010.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

15-15: Hard tabs
Column: 1

(MD010, no-hard-tabs)


19-19: Fix typo in adverb.
Change “If you blinding typecast” to “If you blindly typecast” to correct the typo.

🧰 Tools
🪛 LanguageTool

[grammar] ~19-~19: An auxiliary verb seems to be missing from this progressive structure. Did you mean “you're blinding”, “you are blinding”, or “you were blinding”?
Context: ...the data matches your expected type. If you blinding typecast the data to, for example, an i...

(PRP_VBG)

docs/docs/custom-tests.md (3)

16-18: Use spaces instead of hard tabs and acknowledge pointer inference.
The snippet correctly demonstrates Zog infers *string for tests, enhancing type safety. Also, replace hard tab indentations in these lines with spaces to fix MD010.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

17-17: Hard tabs
Column: 1

(MD010, no-hard-tabs)


26-29: Demonstrate safe type assertions for struct tests.
The example shows casting dataPtr.(*User), highlighting lack of inference for structs. Consider illustrating a safe assertion pattern using:

userPtr, ok := dataPtr.(*User)
if !ok {
  return false
}

to avoid panics.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

27-27: Hard tabs
Column: 1

(MD010, no-hard-tabs)


28-28: Hard tabs
Column: 1

(MD010, no-hard-tabs)


88-94: Fix typo in descriptive text.
In the prose prior to this snippet, correct “flexbility” to “flexibility” to maintain professionalism.

docs/docs/reference.md (2)

18-18: Clarify Transform method signature.
The signature func(valPtr *T or any, ctx z.Ctx) (any, error) may confuse readers. Consider a more idiomatic generic Go signature, e.g.:

schema.Transform(func(data any, ctx z.Ctx) (any, error))

or document the type parameter explicitly:

schema.Transform[T](func(dataPtr T, ctx z.Ctx) (any, error))

94-95: Improve description of Trim.
Change // trims the value of whitespace to // trims leading and trailing whitespace from the string for greater precision.

docs/docs/core-concepts/1-anatomy-of-schema.md (3)

21-21: Refine comment for testOrTransformation.
Consider shortening to // test or transformation applied to the data and adding a comma after “transformation” for clarity.


31-31: Fix missing comma in Catch description.
Insert a comma after “ZogIssues” so the sentence reads:

If this is set, it will "catch" any errors or ZogIssues, set the destination value to this value, and exit.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: A comma might be missing here.
Context: ...(value)` sets a catch value. If this is set it will "catch" any errors or ZogIssues...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~31-~31: Possible missing comma found.
Context: ... code will automatically exit. For more information checkout the [parsing execution structu...

(AI_HYDRA_LEO_MISSING_COMMA)


53-58: Correct grammar in Transforms description.
Update Transforms is a list of function to Transforms are a list of functions to match plurality, and consider renaming to “Transform functions” for consistency.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~53-~53: The verb “is” doesn’t seem to fit in this context, “are” is probably more formally correct.
Context: ...tests) page. ## Transforms Transforms is a list of function that are applied to ...

(AI_HYDRA_LEO_CPT_IS_ARE)


[uncategorized] ~53-~53: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... ## Transforms Transforms is a list of function that are applied to the data at any poi...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2da0c0c and 5f84708.

⛔ Files ignored due to path filters (1)
  • docs/docs/core-concepts/img/parsing-workflow.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • README.md (2 hunks)
  • docs/docs/changes-from-zod.md (1 hunks)
  • docs/docs/core-concepts/1-anatomy-of-schema.md (2 hunks)
  • docs/docs/core-concepts/3-parsing.mdx (1 hunks)
  • docs/docs/core-concepts/parsing-table.tsx (6 hunks)
  • docs/docs/core-design-decisions.md (1 hunks)
  • docs/docs/custom-tests.md (3 hunks)
  • docs/docs/getting-started.md (1 hunks)
  • docs/docs/preprocess.md (1 hunks)
  • docs/docs/reference.md (3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

85-85: Hard tabs
Column: 1

(MD010, no-hard-tabs)


159-159: Hard tabs
Column: 1

(MD010, no-hard-tabs)


160-160: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/getting-started.md

118-118: Hard tabs
Column: 1

(MD010, no-hard-tabs)


119-119: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/preprocess.md

3-3: Link fragments should be valid
null

(MD051, link-fragments)


15-15: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/custom-tests.md

17-17: Hard tabs
Column: 1

(MD010, no-hard-tabs)


74-74: Hard tabs
Column: 1

(MD010, no-hard-tabs)


75-75: Hard tabs
Column: 1

(MD010, no-hard-tabs)


76-76: Hard tabs
Column: 1

(MD010, no-hard-tabs)


77-77: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/reference.md

84-84: Hard tabs
Column: 1

(MD010, no-hard-tabs)


85-85: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🪛 LanguageTool
docs/docs/preprocess.md

[grammar] ~19-~19: An auxiliary verb seems to be missing from this progressive structure. Did you mean “you're blinding”, “you are blinding”, or “you were blinding”?
Context: ...the data matches your expected type. If you blinding typecast the data to, for example, an i...

(PRP_VBG)

docs/docs/core-concepts/3-parsing.mdx

[style] ~87-~87: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...ructure Parsing execution structure is quite simple. It just does roughly this: 1. Check f...

(EN_WEAK_ADJECTIVE)


[style] ~90-~90: ‘take into account’ might be wordy. Consider a shorter alternative.
Context: ...is: 1. Check for nil value - If nil take into account if schema has default value or is requi...

(EN_WORDINESS_PREMIUM_TAKE_INTO_ACCOUNT)


[uncategorized] ~90-~90: You might be missing the article “the” here.
Context: ... value - If nil take into account if schema has default value or is required 2. Coe...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~90-~90: You might be missing the article “a” here.
Context: ... If nil take into account if schema has default value or is required 2. Coerce value to...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[uncategorized] ~91-~91: Possible missing preposition found.
Context: ...ema has default value or is required 2. Coerce value to the correct type otherwise 3. ...

(AI_HYDRA_LEO_MISSING_TO)


[typographical] ~95-~95: Consider adding a comma here.
Context: ...hat error is returned. - If catch is active any error triggers it and stops the exe...

(IF_THAT_S_NOT_POSSIBLE_COMMA)

docs/docs/core-design-decisions.md

[uncategorized] ~12-~12: Possible missing comma found.
Context: ...raps around an error and adds a message field which is text that can be shown to the ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~12-~12: Possible missing comma found.
Context: ...t can be shown to the user. For more on this see Errors - You should not ...

(AI_HYDRA_LEO_MISSING_COMMA)

docs/docs/core-concepts/1-anatomy-of-schema.md

[uncategorized] ~27-~27: A comma might be missing here.
Context: ...f it is required and the data is a zero value the schema will return a [ZogIssue](/er...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~31-~31: A comma might be missing here.
Context: ...(value)` sets a catch value. If this is set it will "catch" any errors or ZogIssues...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~31-~31: Possible missing comma found.
Context: ... code will automatically exit. For more information checkout the [parsing execution structu...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~53-~53: The verb “is” doesn’t seem to fit in this context, “are” is probably more formally correct.
Context: ...tests) page. ## Transforms Transforms is a list of function that are applied to ...

(AI_HYDRA_LEO_CPT_IS_ARE)


[uncategorized] ~53-~53: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ... ## Transforms Transforms is a list of function that are applied to the data at any poi...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[typographical] ~60-~60: Consider adding a comma here.
Context: ...taPtr T, ctx Ctx) error ``` As you can see the function takes a pointer to the dat...

(AS_YOU_CAN_SEE_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test (1.22.x, ubuntu-latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (11)
docs/docs/core-concepts/parsing-table.tsx (6)

191-202: Updated requiredError behavior for Bool() schema: The entries for data: '""' (line 191) and data: '" "' (line 197) now have requiredError: "no". This accurately reflects that empty or whitespace-only inputs no longer trigger a required error by default.


260-272: Updated requiredError behavior for String() schema: The entries for empty "" and " " (lines 261 and 268) are updated to requiredError: "no", aligning with the optional-by-default policy.


309-321: Updated requiredError behavior for Int() schema: The cases for data: '""' and data: '" "' (lines 310 and 317) now set requiredError: "no", correctly reflecting no required error for empty or whitespace-only inputs.


372-384: Updated requiredError behavior for Float() schema: The empty string ("") and whitespace (" ") entries (lines 373 and 380) now have requiredError: "no", consistent with updated documentation.


420-432: Updated requiredError behavior for Time() schema: Changed the empty "" and " " cases (lines 422 and 429) to requiredError: "no", aligning with the new default behavior.


470-482: Updated requiredError behavior for Slice() schema: The cases for data: '""' and data: '" "' (lines 471 and 478) now set requiredError: "no", reflecting no required error for empty or space-only slices.

docs/docs/getting-started.md (1)

113-113: Approve updated section title: The new header “7 Transform Data without limits” clearly reflects the unified transformation approach.

README.md (1)

85-85: Approved: Clarification maintained for optional fields.
The note explaining that empty strings are skipped and fields are optional by default is clear and consistent with the behavior described later.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

85-85: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/custom-tests.md (1)

73-82: Approve generic test function signature update.
Updating to z.Test[any] and using val.(*User) aligns with Go generics and improves clarity on pointer usage.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

74-74: Hard tabs
Column: 1

(MD010, no-hard-tabs)


75-75: Hard tabs
Column: 1

(MD010, no-hard-tabs)


76-76: Hard tabs
Column: 1

(MD010, no-hard-tabs)


77-77: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/docs/core-concepts/1-anatomy-of-schema.md (2)

10-11: Approve updated method chaining order.
Reordering .Trim() before .Min() and .Required() clarifies the sequence in which transformations and tests run, improving readability.


69-78: Approve unified Transform usage example.
The snippet effectively demonstrates both field-level and struct-level Transform chaining, replacing the earlier PostTransform pattern.

Comment on lines +117 to +120
schema := z.Preprocess(func(data any, ctx z.Ctx) ([]string, error) {
s := data.(string) // don't do this, actually check the type
return strings.Split(s, ","), nil
}).PostTransform(func(destPtr any, ctx z.Ctx) error {
s := destPtr.(*[]string)
for i, v := range *s {
(*s)[i] = strings.TrimSpace(v)
}
return nil
}).Parse("[email protected],[email protected]", &dest) // dest = [[email protected] [email protected]]
}, z.Slice(z.String().Trim().Email().Required()))
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard type assertion to avoid panic: The inline type assertion data.(string) can panic if data isn't a string. Use the comma-ok idiom and remove hard tabs:

-    s := data.(string) // don't do this, actually check the type
+    s, ok := data.(string)
+    if !ok {
+      return nil, fmt.Errorf("expected string input, got %T", data)
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
schema := z.Preprocess(func(data any, ctx z.Ctx) ([]string, error) {
s := data.(string) // don't do this, actually check the type
return strings.Split(s, ","), nil
}).PostTransform(func(destPtr any, ctx z.Ctx) error {
s := destPtr.(*[]string)
for i, v := range *s {
(*s)[i] = strings.TrimSpace(v)
}
return nil
}).Parse("[email protected],[email protected]", &dest) // dest = [[email protected] [email protected]]
}, z.Slice(z.String().Trim().Email().Required()))
schema := z.Preprocess(func(data any, ctx z.Ctx) ([]string, error) {
s, ok := data.(string)
if !ok {
return nil, fmt.Errorf("expected string input, got %T", data)
}
return strings.Split(s, ","), nil
}, z.Slice(z.String().Trim().Email().Required()))
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

118-118: Hard tabs
Column: 1

(MD010, no-hard-tabs)


119-119: Hard tabs
Column: 1

(MD010, no-hard-tabs)

Comment on lines 81 to 87
z.Preprocess()
// Usage:
z.Preprocess(func(data any, ctx z.Ctx) (any, error) {
s := data.(string)
return strings.Split(s, ","), nil
}, z.Slice(z.String())))
```
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Correct parentheses and add import.
The example has an extra closing parenthesis and omits the strings import. Update to:

import "strings"

schema := z.Preprocess(
  func(data any, ctx z.Ctx) (any, error) {
    s := data.(string)
    return strings.Split(s, ","), nil
  },
  z.Slice(z.String()),
)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

84-84: Hard tabs
Column: 1

(MD010, no-hard-tabs)


85-85: Hard tabs
Column: 1

(MD010, no-hard-tabs)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@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: 1

🧹 Nitpick comments (2)
docs/docs/core-concepts/3-parsing.mdx (2)

87-87: Avoid weak intensifier for clearer tone
Replace “quite simple” with a more precise adjective to strengthen the prose.

- Parsing execution structure is quite simple. It just does roughly this:
+ Parsing execution structure is straightforward. It follows these steps:
🧰 Tools
🪛 LanguageTool

[style] ~87-~87: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...ructure Parsing execution structure is quite simple. It just does roughly this: 1. Check f...

(EN_WEAK_ADJECTIVE)


90-96: Improve clarity and fix grammar in bullet list

  • Line 90 is wordy and missing articles; rephrase for readability.
  • Line 95 needs a comma after “active” for correct punctuation.
-   - If nil take into account if schema has default value or is required
+   - If nil, check whether the schema has a default value or is marked as required

-   - If catch is active any error triggers it and stops the execution.
+   - If catch is active, any error triggers it and stops the execution.
🧰 Tools
🪛 LanguageTool

[style] ~90-~90: ‘take into account’ might be wordy. Consider a shorter alternative.
Context: ...is: 1. Check for nil value - If nil take into account if schema has default value or is requi...

(EN_WORDINESS_PREMIUM_TAKE_INTO_ACCOUNT)


[uncategorized] ~90-~90: You might be missing the article “the” here.
Context: ... value - If nil take into account if schema has default value or is required 2. Coe...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~90-~90: You might be missing the article “a” here.
Context: ... If nil take into account if schema has default value or is required 2. Coerce value to...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[typographical] ~95-~95: Consider adding a comma here.
Context: ...hat error is returned. - If catch is active any error triggers it and stops the exe...

(IF_THAT_S_NOT_POSSIBLE_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f84708 and 394e599.

📒 Files selected for processing (1)
  • docs/docs/core-concepts/3-parsing.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/core-concepts/3-parsing.mdx

[style] ~87-~87: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ...ructure Parsing execution structure is quite simple. It just does roughly this: 1. Check f...

(EN_WEAK_ADJECTIVE)


[style] ~90-~90: ‘take into account’ might be wordy. Consider a shorter alternative.
Context: ...is: 1. Check for nil value - If nil take into account if schema has default value or is requi...

(EN_WORDINESS_PREMIUM_TAKE_INTO_ACCOUNT)


[uncategorized] ~90-~90: You might be missing the article “the” here.
Context: ... value - If nil take into account if schema has default value or is required 2. Coe...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~90-~90: You might be missing the article “a” here.
Context: ... If nil take into account if schema has default value or is required 2. Coerce value to...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[typographical] ~95-~95: Consider adding a comma here.
Context: ...hat error is returned. - If catch is active any error triggers it and stops the exe...

(IF_THAT_S_NOT_POSSIBLE_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages

7. PostTransforms -> Run all postTransforms on the value.
- On error you return: aborts and adds your error to the list of [ZogIssues](/errors)
- Only run on valid values. Won't run if a [ZogIssue](/errors) was created before the postTransforms
![Zog Schema Parsign Execution Structure](./img/parsing-workflow.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in image alt text
The alt text “Parsig n” is misspelled. Correct it to “Parsing” so the image reference is accurate.

- ![Zog Schema Parsign Execution Structure](./img/parsing-workflow.png)
+ ![Zog Schema Parsing Execution Structure](./img/parsing-workflow.png)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
![Zog Schema Parsign Execution Structure](./img/parsing-workflow.png)
![Zog Schema Parsing Execution Structure](./img/parsing-workflow.png)
🤖 Prompt for AI Agents (early access)
In docs/docs/core-concepts/3-parsing.mdx at line 97, fix the typo in the image alt text by changing "Parsig n" to "Parsing" to ensure the alt text accurately describes the image.

@Oudwins Oudwins merged commit 193c23c into master Apr 30, 2025
8 of 10 checks passed
@Oudwins Oudwins deleted the docs/update-docs branch April 30, 2025 07:41
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.

1 participant