chore: check typos only on changed files in PRs#2221
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Preview for this PR was built for commit |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on February 24
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Comment @cursor review or bugbot run to trigger another review on this PR
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| uses: crate-ci/typos@v1.43.0 | ||
| with: | ||
| files: ${{ steps.changed-files.outputs.all_changed_files }} |
There was a problem hiding this comment.
Spell check fails on deleted files
Medium Severity
The all_changed_files output from tj-actions/changed-files includes deleted files. When passed to the typos action, it will attempt to spell-check files that no longer exist, causing the workflow to fail for any PR that deletes files. This contradicts the PR's goal of preventing unrelated failures. Using all_modified_files (which excludes deleted files) or combining added_files and modified_files would fix this.
| id: changed-files | ||
| uses: tj-actions/changed-files@v47 | ||
| with: | ||
| separator: ' ' |
There was a problem hiding this comment.
Space separator breaks filenames containing spaces
Low Severity
Using separator: ' ' (space) to separate filenames is problematic when any changed file has a space in its name. The tj-actions/changed-files action may quote such filenames, but the crate-ci/typos action receiving this input via files may not correctly parse quoted paths. This would cause spell checking to fail or skip files with spaces in their names. Using a newline separator would be safer.
Additional Locations (1)
vdusek
left a comment
There was a problem hiding this comment.
Is this really what we want? 🙂
Consider this scenario: someone introduces a typo, but it slips past the CI checks and gets merged into master. It fails there once, but won't be flagged in future PRs. As a result, the typo remains in the codebase, and the spell checker treats it as acceptable.
I don't think this is a step in the right direction. In my experience, linters should run against the entire codebase to prevent issues like this.


I've added a step to check only changed files since it has been failing PR's that were not connected to the failed check
Note
Low Risk
CI-only workflow change; risk is limited to possibly missing typos outside the changed file set or mis-detecting changed files due to checkout/diff configuration.
Overview
Updates the GitHub Actions
Spell checkworkflow to runtyposonly against files changed in the PR/push, avoiding failures from unrelated existing typos.This adds
tj-actions/changed-filesand configuresactions/checkoutwithfetch-depth: 0, then gates thetyposstep onany_changedand passesall_changed_filesto the action.Written by Cursor Bugbot for commit 38e51bf. Configure here.