-
Notifications
You must be signed in to change notification settings - Fork 2
Deprecate misspell and replace it with typos #419
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
SuperSandro2000
wants to merge
1
commit into
main
Choose a base branch
from
typos
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.
+156
−70
Open
Changes from all commits
Commits
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
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 |
|---|---|---|
|
|
@@ -56,7 +56,6 @@ linters: | |
| - ineffassign | ||
| - intrange | ||
| - iotamixing | ||
| - misspell | ||
| - modernize | ||
| - nilerr | ||
| - nolintlint | ||
|
|
||
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,11 @@ | ||
| # SPDX-FileCopyrightText: 2025 SAP SE | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [default.extend-words] | ||
|
|
||
| [files] | ||
| extend-exclude = [ | ||
| "go.mod", | ||
| "vendor/", | ||
| ] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,6 @@ const ( | |
| GoCoverageReportAction = "fgrosse/[email protected]" | ||
| GolangciLintAction = "golangci/golangci-lint-action@v9" | ||
| GoreleaserAction = "goreleaser/goreleaser-action@v6" | ||
| MisspellAction = "reviewdog/action-misspell@v1" | ||
| ReuseAction = "fsfe/reuse-action@v6" | ||
| TyposAction = "crate-ci/typos@v1" | ||
| ) | ||
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,9 +4,6 @@ | |||||||||
| package ghworkflow | ||||||||||
|
|
||||||||||
| import ( | ||||||||||
| "fmt" | ||||||||||
| "strings" | ||||||||||
|
|
||||||||||
| "github.com/sapcc/go-makefile-maker/internal/core" | ||||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
@@ -27,7 +24,7 @@ func checksWorkflow(cfg core.Configuration) { | |||||||||
| }, | ||||||||||
| }) | ||||||||||
|
|
||||||||||
| if cfg.ShellCheck.Enabled.UnwrapOr(true) { | ||||||||||
| if cfg.ShellCheck.IsEnabled() { | ||||||||||
| // delete the pretty out of date installed version of shellcheck so that make install-shellcheck installs the current version | ||||||||||
| if !ghwCfg.IsSelfHostedRunner { | ||||||||||
| j.addStep(jobStep{ | ||||||||||
|
|
@@ -48,27 +45,17 @@ func checksWorkflow(cfg core.Configuration) { | |||||||||
| }) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if !ghwCfg.IsSelfHostedRunner { | ||||||||||
| with := map[string]any{ | ||||||||||
| "exclude": "./vendor/*", | ||||||||||
| "reporter": "github-check", | ||||||||||
| "fail_on_error": true, | ||||||||||
| "github_token": "${{ secrets.GITHUB_TOKEN }}", | ||||||||||
| "ignore": "importas", //nolint:misspell //importas is a valid linter name, so we always ignore it | ||||||||||
| } | ||||||||||
| ignoreWords := cfg.SpellCheck.IgnoreWords | ||||||||||
| if len(ignoreWords) > 0 { | ||||||||||
| with["ignore"] = fmt.Sprintf("%s,%s", with["ignore"], strings.Join(ignoreWords, ",")) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| w.Permissions.Checks = tokenScopeWrite // for nicer output in pull request diffs | ||||||||||
| w.Permissions.PullRequests = tokenScopeRead // for private repos | ||||||||||
| j.addStep(jobStep{ | ||||||||||
| Name: "Check for spelling errors", | ||||||||||
| Uses: core.MisspellAction, | ||||||||||
| With: with, | ||||||||||
| }) | ||||||||||
| } | ||||||||||
| j.addStep(jobStep{ | ||||||||||
| Name: "Check for spelling errors", | ||||||||||
| Uses: core.TyposAction, | ||||||||||
| Env: map[string]string{ | ||||||||||
| "CLICOLOR": "1", | ||||||||||
| }, | ||||||||||
| }) | ||||||||||
| j.addStep(jobStep{ | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As always, surprising actions should be documented.
Suggested change
|
||||||||||
| Name: "Delete typos binary", | ||||||||||
| Run: "rm typos", | ||||||||||
| }) | ||||||||||
|
|
||||||||||
| if ghwCfg.License.IsEnabled() { | ||||||||||
| j.addStep(jobStep{ | ||||||||||
|
|
||||||||||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package typos | ||
|
|
||
| import ( | ||
| _ "embed" | ||
|
|
||
| "github.com/sapcc/go-bits/must" | ||
|
|
||
| "github.com/sapcc/go-makefile-maker/internal/core" | ||
| "github.com/sapcc/go-makefile-maker/internal/util" | ||
| ) | ||
|
|
||
| var ( | ||
| //go:embed typos.toml.tmpl | ||
| typosConfigTemplate string | ||
| ) | ||
|
|
||
| func RenderConfig(cfg core.Configuration) { | ||
| extendExcludes := []string{"go.mod"} | ||
| if cfg.Golang.EnableVendoring { | ||
| extendExcludes = append(extendExcludes, "vendor/") | ||
| } | ||
| extendExcludes = append(extendExcludes, cfg.Typos.ExtendExcludes...) | ||
|
|
||
| must.Succeed(util.WriteFileFromTemplate(".typos.toml", typosConfigTemplate, map[string]any{ | ||
| "ExtendExcludes": extendExcludes, | ||
| "ExtendWords": cfg.Typos.ExtendWords, | ||
| })) | ||
| } |
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,13 @@ | ||
| # SPDX-FileCopyrightText: 2025 SAP SE | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [default.extend-words] | ||
| {{ range $key, $value := .ExtendWords -}} | ||
| {{$key}} = "{{$value}}" | ||
| {{ end }} | ||
| [files] | ||
| extend-exclude = [ | ||
| {{- range .ExtendExcludes}} | ||
| "{{.}}",{{ end }} | ||
| ] |
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.