-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Spell Checker #8495
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
chaptersix
wants to merge
11
commits into
main
Choose a base branch
from
alex/spell
base: main
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.
+115
−1
Open
Spell Checker #8495
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d22aeee
Add typos spell checker to linters
chaptersix ea5ff83
Add typo dictionary exceptions to typos config
chaptersix db33930
only files in the diff
chaptersix d1b2104
fix
chaptersix 6e92d2f
add test mis-spell
chaptersix a2b98dd
undo
chaptersix d44caa1
Apply suggestions from code review
chaptersix 310d1cb
Merge branch 'main' into alex/spell
chaptersix a242b30
remove configs that are not needed
chaptersix 5fffd58
add inline ignore config
chaptersix f141448
add different spelling of Invoce
chaptersix 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,63 @@ | ||
| # Configuration for typos spell checker | ||
| # See: https://github.com/crate-ci/typos | ||
|
|
||
| [default] | ||
chaptersix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Ensure we check binary file names | ||
| binary = false | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [default.extend-words] | ||
| # Add custom dictionary entries here for intentional "misspellings" used in the codebase | ||
| # Preemptable is used consistently instead of "Preemptible" for caller types | ||
| Preemptable = "Preemptable" | ||
| preemptable = "preemptable" | ||
| # "ba" is a legitimate variable name in merge tests (shorthand for "b merged with a") | ||
| ba = "ba" | ||
| # Hash strings may contain letter combinations that look like typos | ||
| Ue = "Ue" | ||
| # Test data and base64 strings that contain letter combinations that look like typos | ||
| nd = "nd" | ||
| abd = "abd" | ||
| # Environment variable name that must remain for backwards compatibility | ||
| AVAILABILTY = "AVAILABILTY" | ||
| # Proto-generated field names that have typos in the proto definition | ||
| # These should be fixed in the proto file first, then regenerated | ||
| Heartbeart = "Heartbeart" | ||
| heartbeart = "heartbeart" | ||
chaptersix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [files] | ||
| # Exclude generated protobuf files | ||
| extend-exclude = [ | ||
| "*.pb.go", | ||
| "*.pb.gw.go", | ||
| "*.proto", | ||
| "*.binpb", | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # Exclude other generated or third-party files | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "*.gen.go", | ||
| "*.json.gz", | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ".bin/**", | ||
| ".testoutput/**", | ||
| "vendor/**", | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ".stamp/**", | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "**/testdata/**", | ||
| # Exclude SVG files - they contain hex color codes that trigger false positives (e.g., #f38BA8) | ||
chaptersix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "*.svg", | ||
| ] | ||
|
|
||
| [type.go] | ||
| extend-glob = ["*.go"] | ||
|
|
||
| # Inline typos ignore comments: | ||
| # To ignore a specific line, add a comment on the same line or the line before: | ||
| # // typos:disable-next-line | ||
| # var myVar = "mispeling" // intentional | ||
| # | ||
| # To ignore a specific word on a line: | ||
| # var myVar = "mispeling" // typos:ignore | ||
| # | ||
| # To disable checking for an entire file, add at the top: | ||
| # // typos:disable-file | ||
| # | ||
| # To check only changed files (useful for local development): | ||
| # git diff --name-only --diff-filter=ACMR main...HEAD | typos --file-list - | ||
| # Or check only staged files: | ||
| # git diff --cached --name-only | typos --file-list - | ||
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 |
|---|---|---|
|
|
@@ -133,6 +133,28 @@ jobs: | |
| exit 1 | ||
| fi | ||
|
|
||
| typos: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Get changed files | ||
| id: changed-files | ||
| env: | ||
| BASE_REF: ${{ github.base_ref }} | ||
| run: | | ||
| git diff --name-only --diff-filter=ACMR "origin/${BASE_REF}"...HEAD | tr '\n' ' ' > changed_files.txt | ||
| echo "files=$(cat changed_files.txt)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: check spelling with typos on changed files | ||
| if: steps.changed-files.outputs.files != '' | ||
| uses: crate-ci/[email protected] | ||
| with: | ||
| config: .github/_typos.toml | ||
chaptersix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| files: ${{ steps.changed-files.outputs.files }} | ||
|
|
||
| linters-succeed: | ||
| name: All Linters Succeed | ||
| needs: | ||
|
|
@@ -141,6 +163,7 @@ jobs: | |
| - lint-actions | ||
| - fmt-imports | ||
| - golangci | ||
| - typos | ||
| runs-on: ubuntu-latest | ||
| if: always() | ||
| env: | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.