-
Notifications
You must be signed in to change notification settings - Fork 8
Add codespell support (config, workflow to detect/not fix) and make it fix some typos #457
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
base: main
Are you sure you want to change the base?
Conversation
…s automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
WalkthroughAdds Codespell to the project via a new GitHub Actions workflow, a pre-commit hook, and configuration in pyproject.toml. Fixes minor typos in two example notebooks. No code logic or public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub
participant WF as Workflow: Codespell
participant CS as Codespell Action
participant PM as Problem Matcher
Dev->>GH: Push / Open PR (target: main)
GH-->>WF: Trigger workflow
rect rgba(220,235,255,0.5)
note right of WF: Job on ubuntu-latest
WF->>WF: actions/checkout@v4
WF->>PM: Setup codespell-problem-matcher@v1
WF->>CS: codespell-project/actions-codespell@v2
CS-->>GH: Report annotations using settings from pyproject.toml
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (7)
notebooks/example_config.ipynb (2)
9-9
: Nit: hyphenation for clarity.Prefer “high-level interface”.
- ... and provides a high level interface for users ... + ... and provides a high-level interface for users ...
29-29
: Nit: punctuation.Add a comma after “After the initial import”.
-After the initial import the class is initialized ... +After the initial import, the class is initialized ...pyproject.toml (1)
119-125
: Codespell config looks good; consider a few small improvements.Optional tweaks to reduce noise and catch more issues.
[tool.codespell] # Ref: https://github.com/codespell-project/codespell#using-a-config-file skip = '.git*' check-hidden = true ignore-regex = '^\s*"image/\S+": ".*' # ignore-words-list = '' +check-filenames = true +# Also commonly skipped: +# skip = '.git*,.ipynb_checkpoints,*-lock.json,*.lock' +# Example domain words (uncomment if Codespell flags them): +# ignore-words-list = 'pysqa,jobid,jovyan,flux,queuing'notebooks/example_queue_type.ipynb (2)
29-29
: Subject-verb agreement and hyphenation.Use parallel verbs with “either … or …” and hyphenate “high-level”.
-The `pysqa` package primarily defines one class, that is the `QueueAdapter`. It can either load the configuration from a configuration directory, or initializes the corresponding adapter for the specific queuing system type `queue_type` and provides a high level interface ... +The `pysqa` package primarily defines one class, the `QueueAdapter`. It can either load the configuration from a configuration directory or initialize the corresponding adapter for the specific queuing system type `queue_type` and provides a high-level interface ...
47-47
: Nit: punctuation.Add a comma after “After the initial import”.
-After the initial import the class is initialized ... +After the initial import, the class is initialized ....pre-commit-config.yaml (1)
12-16
: Optional: ensure pre-commit uses the same config as CI.Passing the TOML path makes the hook behavior explicit and consistent with the GitHub Action.
.github/workflows/codespell.yml (1)
19-26
: Optional: minor workflow hardening.
- Add concurrency to cancel superseded runs.
- Enable filename checks to catch typos in file names.
jobs: codespell: name: Check for spelling errors runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout uses: actions/checkout@v4 - name: Annotate locations with typos uses: codespell-project/codespell-problem-matcher@v1 - name: Codespell uses: codespell-project/actions-codespell@v2 + with: + check_filenames: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.github/workflows/codespell.yml
(1 hunks).pre-commit-config.yaml
(1 hunks)notebooks/example_config.ipynb
(2 hunks)notebooks/example_queue_type.ipynb
(2 hunks)pyproject.toml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.pre-commit-config.yaml
[error] 11-11: trailing spaces
(trailing-spaces)
[warning] 16-16: wrong indentation: expected 6 but found 4
(indentation)
|
||
- repo: https://github.com/codespell-project/codespell | ||
# Configuration for codespell is in .pre-commit-config.yaml | ||
rev: v2.4.1 | ||
hooks: | ||
- id: codespell |
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.
Fix YAML trailing whitespace and indentation; codespell hook may be ignored.
Remove trailing spaces (Line 11) and indent the hook list under hooks:
; also fix the incorrect comment.
- - id: ruff-format
- name: ruff format
-
+ - id: ruff-format
+ name: ruff format
+
- repo: https://github.com/codespell-project/codespell
- # Configuration for codespell is in .pre-commit-config.yaml
+ # Configuration for codespell is in pyproject.toml
rev: v2.4.1
hooks:
- - id: codespell
+ - id: codespell
+ args: ["--toml", "pyproject.toml"]
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 11-11: trailing spaces
(trailing-spaces)
[warning] 16-16: wrong indentation: expected 6 but found 4
(indentation)
🤖 Prompt for AI Agents
In .pre-commit-config.yaml around lines 11 to 16, remove the trailing whitespace
on line 11, fix the comment (remove or replace the misleading "Configuration for
codespell is in .pre-commit-config.yaml") and properly indent the hook list
under `hooks:` so the `- id: codespell` line is nested beneath `hooks:`
(consistent YAML indentation), ensuring the `repo:` and `rev:` keys remain at
the same level as `hooks:`.
More about codespell: https://github.com/codespell-project/codespell .
I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.
CI workflow has 'permissions' set only to 'read' so also should be safe.
But congrats - no typos elsewhere!?!
Summary by CodeRabbit
Chores
Documentation