-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add codespell support (config, workflow to detect/not fix) and make it fix few typos #6872
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
Open
yarikoptic
wants to merge
5
commits into
caddyserver:master
Choose a base branch
from
yarikoptic:enh-codespell
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−7
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6d40251
Add github action to codespell master on push and PRs
yarikoptic 8b02800
Add rudimentary codespell config with some skips
yarikoptic 430910e
Annotate to ignore a line with forced first 5 symbols
yarikoptic 362cdaa
Ignore some words pointed out in PR review
yarikoptic 2eb49c4
[DATALAD RUNCMD] run codespell throughout fixing few left typos autom…
yarikoptic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[codespell] | ||
# Ref: https://github.com/codespell-project/codespell#using-a-config-file | ||
skip = .git*,go.sum,.codespellrc,.golangci.yml | ||
check-hidden = true | ||
# ignore-regex = | ||
# "idiosyncracies" or reflections of some config values like pass_thru | ||
ignore-words-list = ot,te,ond,fo,tread,noes,pass-thru,pass-thrus,keep-alives | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Codespell configuration is within .codespellrc | ||
--- | ||
name: Codespell | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
codespell: | ||
name: Check for spelling errors | ||
runs-on: ubuntu-latest | ||
|
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are
ot
,te
,ond
,fo
, and why istread
on there? (Tread is a dictionary word.)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.
an example of hits for `ot`
tread
is indeed a correct word but rare to encounter in code, more often a typo fromthread
, hence here (I guess).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.
Oh ... this checks spelling of variable names too?
I was kinda hoping it would just do comments and maybe strings.
I dunno. I'm still not super convinced that this is a net help for the project. I like the idea but in practice I can see it requires maintaining exceptions more than the occasional typo fix.
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.
that's somewhat of a beauty of the codespell that it is a very basic tool which identifies words (regardless of the programming language etc) and see which ones are close hits to typos. I do once-a-while run into fixing bugs where variable in a scripted (e.g. python or JS) program was mistyped and never covered by tests, thus never detected... Of cause YMMV, but you might appreciate the low number of false positives (besides those non-descript short variable names) it ran into in caddy's entire codebase.