-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add spell check workflow and configuration #92
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughA new spell-checking workflow has been introduced to the repository, involving the creation of a GitHub Actions workflow file, a Typos configuration file, and a supporting shell script. The workflow is designed to run spell checks automatically on pull requests using the Typos tool, with a configuration set to use US English locale. The accompanying shell script provides flexible configuration options for running the spell-check process. Additionally, minor corrections have been made in documentation and HTML content across various files. Changes
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
scripts/spellcheck.sh (2)
12-16
: Enhance option parsing robustness.Consider using
getopts
for more maintainable option parsing, especially if more options might be added in the future.Here's an improved implementation:
-# Enable help flag -if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then - show_help - exit 0 -fi +# Parse options +while getopts ":h-:" opt; do + case $opt in + h) + show_help + exit 0 + ;; + -) + case "${OPTARG}" in + help) + show_help + exit 0 + ;; + *) + echo "Invalid option: --${OPTARG}" >&2 + show_help + exit 1 + ;; + esac + ;; + ?) + echo "Invalid option: -${OPTARG}" >&2 + show_help + exit 1 + ;; + esac +done +shift $((OPTIND-1))
1-36
: Add documentation and ensure proper file formatting.The script would benefit from:
- A header comment block explaining its purpose and requirements
- A newline at the end of file
Add this documentation at the start of the file:
#!/bin/bash +# Script: spellcheck.sh +# Purpose: Runs the typos spell checker with configurable settings +# Requirements: +# - typos (https://github.com/crate-ci/typos) + show_help() {Also ensure there's a newline at the end of the file.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/spellcheck.yml
(1 hunks).typos.toml
(1 hunks)scripts/spellcheck.sh
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- .typos.toml
- .github/workflows/spellcheck.yml
🔇 Additional comments (1)
scripts/spellcheck.sh (1)
1-36
: Verify path handling and GitHub Actions integration.Please ensure:
- The script handles paths with spaces correctly
- The script integrates properly with the GitHub Action workflow
Run this verification script:
✅ Verification successful
Path handling verified, GitHub Actions integration exists via dedicated workflow
The script correctly handles paths with spaces, and spell checking is properly integrated into GitHub Actions through a dedicated
spellcheck.yml
workflow. No changes needed.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify script behavior with spaces in paths and GitHub Actions integration # Test 1: Check if the script is referenced in GitHub Actions workflow echo "Checking GitHub Actions workflow integration..." rg -l "spellcheck.sh" .github/workflows/ # Test 2: Create test files with spaces in paths mkdir -p "test dir" cp .typos.toml "test dir/my config.toml" ./scripts/spellcheck.sh "test dir/my config.toml"Length of output: 359
Script:
#!/bin/bash # Check for workflow files and typos-related configurations echo "Checking for GitHub Actions workflows..." fd -e yml -e yaml . .github/workflows/ echo -e "\nChecking for typos-related configurations in workflows..." rg -l "typos" .github/workflows/Length of output: 416
Thank you for this submission @navanpreet! Would you mind handling (either adding to a whitelist or fixing) the typos that were picked up as well? Documentation for usage in the |
Will do! |
There was a problem hiding this 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
🧹 Nitpick comments (2)
CONTRIBUTING.md (2)
73-77
: Add installation and script execution instructions.While the command example is clear, consider adding:
- Instructions for installing the
typos
tool- A note about making the script executable (e.g.,
chmod +x scripts/spellcheck.sh
)This will help first-time contributors get started more easily.
79-80
: Enhance configuration documentation with examples.Consider adding:
- An example of passing additional arguments to the script
- Common use cases for argument forwarding (e.g., checking specific files or directories)
Example:
For instance, to check only markdown files: ```bash ./scripts/spellcheck.sh "**/*.md"</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: .coderabbit.yml** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between ddbe04bf91969ed16aeae44455462012b5ffc6f4 and a04b54a952eb5f2502a8067403ace03c15e5e453. </details> <details> <summary>📒 Files selected for processing (7)</summary> * `.typos.toml` (1 hunks) * `CONTRIBUTING.md` (1 hunks) * `bundled/tool/zenml_wrappers.py` (1 hunks) * `scripts/spellcheck.sh` (1 hunks) * `src/commands/stack/StackForm.ts` (1 hunks) * `src/common/panels.ts` (1 hunks) * `src/test/python_tests/requirements.in` (1 hunks) </details> <details> <summary>✅ Files skipped from review due to trivial changes (4)</summary> * src/test/python_tests/requirements.in * bundled/tool/zenml_wrappers.py * src/commands/stack/StackForm.ts * src/common/panels.ts </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary> * .typos.toml * scripts/spellcheck.sh </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>CONTRIBUTING.md (1)</summary> `71-72`: **LGTM! Well-structured section header.** The new section is properly placed and follows the document's formatting conventions. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@strickvl I slightly tweaked things based on your comment. I've made some adjustments to the implementation after thinking about the trade-offs between a wrapper script versus direct |
Hey! Found this issue randomly and thought I'd make a quick PR to help out.
scripts/spellcheck.sh
to runtypos
commandcrate-ci/[email protected]
Let me know if you’d like me to:
.typos.toml
typos
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
updateForm
method parameter.Chores