Skip to content

Fix grammar in custom rule docs - #1295

Closed
stvnzhou86 wants to merge 2 commits into
ealush:latestfrom
stvnzhou86:patch-1
Closed

Fix grammar in custom rule docs#1295
stvnzhou86 wants to merge 2 commits into
ealush:latestfrom
stvnzhou86:patch-1

Conversation

@stvnzhou86

@stvnzhou86 stvnzhou86 commented May 12, 2026

Copy link
Copy Markdown
Q A
Bug fix?
New feature?
Breaking change?
Deprecations?
Documentation?
Tests added?
Types added?
Related issues

Fixes a small grammar issue in the custom rule documentation:

  • function ... return -> function ... returns

This is a documentation-only change.

Summary by CodeRabbit

  • Documentation
    • Updated documentation for custom rules to clarify return value options (boolean or object with pass and message function) and error message generation behavior.

Review Change Stack

Corrected grammar in the documentation regarding custom rules return values.
Remove unnecessary empty line at the beginning of the document.
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

@stvnzhou86 is attempting to deploy a commit to the ealush's projects Team on Vercel.

A member of the Team first needs to authorize it.

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Fix grammar in custom rule documentation

📝 Documentation

Grey Divider

Walkthroughs

Description
• Fix grammar: "return" to "returns" in custom rules documentation
• Correct verb conjugation for function return description
Diagram
flowchart LR
  A["Documentation File"] -- "Grammar correction" --> B["'return' → 'returns'"]
  B -- "Updated" --> C["Custom Rules Docs"]
Loading

Grey Divider

File Changes

1. website/docs/enforce/creating_custom_rules.md 📝 Documentation +1/-1

Fix verb conjugation in custom rules documentation

• Fixed grammar: changed "return an error message" to "returns an error message"
• Corrected verb conjugation in the custom rules return value documentation
• Improved clarity of function behavior description

website/docs/enforce/creating_custom_rules.md


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 12, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Advisory comments

1. Versioned docs grammar mismatch 🐞 Bug ⚙ Maintainability
Description
The grammar fix was applied only to the unversioned docs, but the same sentence in the 4.x/5.x
versioned docs still uses the old wording ("that return"). Users selecting those versions in the
docs site will see inconsistent documentation text.
Code

website/docs/enforce/creating_custom_rules.md[67]

+Rules can either return boolean indicating success or failure, or an object with two keys. `pass` indicates whether the validation is successful or not, and message provides a function with no arguments that returns an error message in case of failure. Thus, when pass is false, message should return the error message for when enforce(x).yourRule() fails.
Evidence
The current (unversioned) doc now says "that returns", while both published versioned docs still say
"that return"; versions.json confirms those versions are published.

website/docs/enforce/creating_custom_rules.md[65-68]
website/versioned_docs/version-4.x/enforce/creating_custom_rules.md[62-65]
website/versioned_docs/version-5.x/enforce/creating_custom_rules.md[62-65]
website/versions.json[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The grammar fix in `website/docs/...` was not applied to the Docusaurus versioned docs (`website/versioned_docs/version-4.x` and `version-5.x`), so the same paragraph appears with different wording across versions.

## Issue Context
The site publishes versions listed in `website/versions.json`, so readers can switch between `4.x` and `5.x` and still hit the older sentence.

## Fix Focus Areas
- website/versioned_docs/version-4.x/enforce/creating_custom_rules.md[62-65]
- website/versioned_docs/version-5.x/enforce/creating_custom_rules.md[62-65]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request corrects a grammatical error in the documentation for creating custom rules. The reviewer suggested further enhancements to the sentence for better clarity and consistency, including the use of backticks for property names and code snippets, and adding a missing indefinite article.

## Custom rules return value

Rules can either return boolean indicating success or failure, or an object with two keys. `pass` indicates whether the validation is successful or not, and message provides a function with no arguments that return an error message in case of failure. Thus, when pass is false, message should return the error message for when enforce(x).yourRule() fails.
Rules can either return boolean indicating success or failure, or an object with two keys. `pass` indicates whether the validation is successful or not, and message provides a function with no arguments that returns an error message in case of failure. Thus, when pass is false, message should return the error message for when enforce(x).yourRule() fails.

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.

medium

While the grammar fix for 'returns' is correct, there are several other opportunities to improve the clarity and consistency of this sentence. Specifically: add the indefinite article 'a' before 'boolean', and use backticks for property names (message, pass), literal values (false), and code snippets (enforce(x).yourRule()) to match the style used elsewhere in the documentation.

Suggested change
Rules can either return boolean indicating success or failure, or an object with two keys. `pass` indicates whether the validation is successful or not, and message provides a function with no arguments that returns an error message in case of failure. Thus, when pass is false, message should return the error message for when enforce(x).yourRule() fails.
Rules can either return a boolean indicating success or failure, or an object with two keys. `pass` indicates whether the validation is successful or not, and `message` provides a function with no arguments that returns an error message in case of failure. Thus, when `pass` is `false`, `message` should return the error message for when `enforce(x).yourRule()` fails.

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8beb769-b048-4637-ba20-b1c43599abea

📥 Commits

Reviewing files that changed from the base of the PR and between 7e44d61 and fecd56b.

📒 Files selected for processing (1)
  • website/docs/enforce/creating_custom_rules.md

📝 Walkthrough

Walkthrough

Documentation clarifies that custom rules may return either a boolean or an object with pass and message properties, detailing how error messages are generated when validation fails.

Changes

Documentation Clarification

Layer / File(s) Summary
Custom Rules Return Value Documentation
website/docs/enforce/creating_custom_rules.md
The explanatory paragraph under "Custom rules return value" was refined to clarify how custom rules can return either a boolean or an object with pass and message fields, and how error messages are generated during validation failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A sentence rewritten, so clear and so bright, 🐰
Custom rules now shine with pellucid light,
Return bools or messages, fail or succeed,
The docs now explain all that you'll need! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix grammar in custom rule docs' directly and clearly summarizes the main change: correcting grammar in the custom rules documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@stvnzhou86 stvnzhou86 closed this by deleting the head repository May 26, 2026
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