Skip to content

Commit c38064d

Browse files
authored
chore: fix typos in comments and tests; enable misspell (#3573)
1 parent 656cdc0 commit c38064d

File tree

21 files changed

+32
-32
lines changed

21 files changed

+32
-32
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# working-directory: somedir
2929

3030
# Optional: golangci-lint command line arguments.
31-
args: --enable bodyclose --enable copyloopvar --timeout 10m
31+
args: --enable bodyclose --enable copyloopvar --enable misspell --timeout 10m
3232

3333
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
3434
# skip-pkg-cache: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ check:
2222
go vet $(shell go list ./... | grep -v /vendor/)
2323

2424
lint:
25-
golangci-lint run --enable bodyclose --enable copyloopvar --out-format=colored-line-number --timeout 10m
25+
golangci-lint run --enable bodyclose --enable copyloopvar --enable misspell --out-format=colored-line-number --timeout 10m
2626

2727
test-failing:
2828
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/) | grep FAIL

pkg/analyzer/analyzers/mysql/mysql.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {
5252
Bindings: []analyzers.Binding{},
5353
}
5454

55-
// add user priviliges to bindings
55+
// add user privileges to bindings
5656
userBindings, userResource := bakeUserBindings(info)
5757
result.Bindings = append(result.Bindings, userBindings...)
5858

59-
// add user's database priviliges to bindings
59+
// add user's database privileges to bindings
6060
databaseBindings := bakeDatabaseBindings(userResource, info)
6161
result.Bindings = append(result.Bindings, databaseBindings...)
6262

@@ -67,7 +67,7 @@ func bakeUserBindings(info *SecretInfo) ([]analyzers.Binding, *analyzers.Resourc
6767

6868
var userBindings []analyzers.Binding
6969

70-
// add user and their priviliges to bindings
70+
// add user and their privileges to bindings
7171
userResource := analyzers.Resource{
7272
Name: info.User,
7373
FullyQualifiedName: info.Host + "/" + info.User,

pkg/analyzer/analyzers/postgres/postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {
5454
userResource, userBindings := bakeUserBindings(info)
5555
result.Bindings = append(result.Bindings, userBindings...)
5656

57-
// add user's database priviliges to bindings
57+
// add user's database privileges to bindings
5858
dbNameToResourceMap, dbBindings := bakeDatabaseBindings(userResource, info)
5959
result.Bindings = append(result.Bindings, dbBindings...)
6060

61-
// add user's table priviliges to bindings
61+
// add user's table privileges to bindings
6262
tableBindings := bakeTableBindings(dbNameToResourceMap, info)
6363
result.Bindings = append(result.Bindings, tableBindings...)
6464

pkg/analyzer/analyzers/sourcegraph/sourcegraph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:generate generate_permissions permissions.yaml permissions.go sourcegraph
22
package sourcegraph
33

4-
// ToDo: Add suport for custom domain
4+
// ToDo: Add support for custom domain
55

66
import (
77
"encoding/json"

pkg/common/patterns_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestEmailRegexCheck(t *testing.T) {
2525
hyphen domain = info@my-site.net
2626
service email = contact@web-service.io
2727
underscore email = example_user@domain.info
28-
departement email = first.last@department.company.edu
28+
department email = first.last@department.company.edu
2929
alphanumeric email = user1234@domain.co
3030
local server email = admin@local-server.local
3131
dot email = test.email@my-email-service.xyz

pkg/detectors/agora/agora_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var (
1515
validKeyPattern = "asdf0987mnbv1234qsxojb6ygb2wsx0o"
1616
validSecretPattern = "beqr7215fr4g6bfjkmnvxrtygb2wsxap"
1717
complexPattern = `agora credentials
18-
these are some example credentails for login.
18+
these are some example credentials for login.
1919
use these to login.
2020
key: asdf0987mnbv1234qsxojb6ygb2wsx0o
2121
secret: beqr7215fr4g6bfjkmnvxrtygb2wsxap

pkg/detectors/alchemy/alchemy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ alchemy_token2 = '3aDcDFE56789012245678a0_1a2b3c2d'`,
2828
want: []string{"3aBcDFE5678901234567890_1a2b3c4d", "3aDcDFE56789012245678a0_1a2b3c2d"},
2929
},
3030
{
31-
name: "invald pattern",
31+
name: "invalid pattern",
3232
input: "alchemy_token = '1a2b3c4d'",
3333
want: []string{},
3434
},

pkg/detectors/apimatic/apimatic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
6666
s1.Verified = true
6767
}
6868
} else {
69-
// if any error happens during api request capture that as verificaiton error
69+
// if any error happens during api request capture that as verification error
7070
s1.SetVerificationError(err, apiKey)
7171
}
7272
}

pkg/detectors/appfollow/appfollow_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ func TestAppFollow_Pattern(t *testing.T) {
2727
}{
2828
{
2929
name: "valid pattern",
30-
input: fmt.Sprintf("appfollow credentail: %s", validPattern),
30+
input: fmt.Sprintf("appfollow credential: %s", validPattern),
3131
want: []string{"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.333HbjEo1oxVUFcASR0sQ8cMuIJRLcMd5H9iJWDbovCw6ESjNtuoEMQQGPN9aSoxponxrTPvn1.btADhgNetsaUBuwoyHo5ip0Jab6N6MEBnSaT6CHiO6z"},
3232
},
3333
{
3434
name: "invalid pattern",
35-
input: fmt.Sprintf("appfollow credentail: %s", invalidPattern),
35+
input: fmt.Sprintf("appfollow credential: %s", invalidPattern),
3636
want: nil,
3737
},
3838
}

pkg/detectors/appointedd/appointedd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ func TestAppFollow_Pattern(t *testing.T) {
2727
}{
2828
{
2929
name: "valid pattern",
30-
input: fmt.Sprintf("appointedd credentail: %s", validPattern),
30+
input: fmt.Sprintf("appointedd credential: %s", validPattern),
3131
want: []string{"Ci0a2bSpRyFcZyEXBEr9RHzf3xXllqO=XVoh+t0L0s8T2s3MFntfWhBlovqLaqEadtuJ9=Jy6yCOXmhbpEZPfY7Y"},
3232
},
3333
{
3434
name: "invalid pattern",
35-
input: fmt.Sprintf("appointedd credentail: %s", invalidPattern),
35+
input: fmt.Sprintf("appointedd credential: %s", invalidPattern),
3636
want: nil,
3737
},
3838
}

pkg/detectors/appoptics/appoptics_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ func TestAppOptics_Pattern(t *testing.T) {
2727
}{
2828
{
2929
name: "valid pattern",
30-
input: fmt.Sprintf("appoptics credentail: %s", validPattern),
30+
input: fmt.Sprintf("appoptics credential: %s", validPattern),
3131
want: []string{"IABJPR08RmvsGrebJhr1TUdo27-KtTn0mLCKkJJqj5lyba-otXPklygO9DK62o3QSPoIJ4E"},
3232
},
3333
{
3434
name: "invalid pattern",
35-
input: fmt.Sprintf("appoptics credentail: %s", invalidPattern),
35+
input: fmt.Sprintf("appoptics credential: %s", invalidPattern),
3636
want: nil,
3737
},
3838
}

pkg/detectors/appsynergy/appsynergy_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ func TestAppSynergy_Pattern(t *testing.T) {
2727
}{
2828
{
2929
name: "valid pattern",
30-
input: fmt.Sprintf("appsynergy credentail: %s", validPattern),
30+
input: fmt.Sprintf("appsynergy credential: %s", validPattern),
3131
want: []string{"mg1pgwlndtq7rbk8i3kum344aso8ggp02ximdhsp8nsqasd3btxf84lz9ekfdpwo"},
3232
},
3333
{
3434
name: "invalid pattern",
35-
input: fmt.Sprintf("appsynergy credentail: %s", invalidPattern),
35+
input: fmt.Sprintf("appsynergy credential: %s", invalidPattern),
3636
want: nil,
3737
},
3838
}

pkg/detectors/auth0managementapitoken/auth0managementapitoken_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var (
1919
validPattern = generateRandomString() // this has the exact token string only which can be used in want too
2020
validDomain = "QHHPu7VPj.sI.auth0.com"
2121
invalidPattern = `
22-
auth0_credentails:
22+
auth0_credentials:
2323
apiToken: eywT2nGMZwOcbsUVBwfiRPEl8P_wnmo6XfdUoGVwxDfOSjNyqhYqFdi.KojZZOM8Ox
2424
domain: QHHPu7VPj.sI.auth0.com
2525
`

pkg/detectors/boxoauth/boxoauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
8080

8181
results = append(results, s1)
8282

83-
// box client supportes only one client id and secret pair
83+
// box client supports only one client id and secret pair
8484
if s1.Verified {
8585
break
8686
}

pkg/detectors/sentrytoken/sentrytoken_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestSentryToken_FromChunk(t *testing.T) {
125125
},
126126
{
127127
name: "found, account deactivated",
128-
s: Scanner{client: common.ConstantResponseHttpClient(200, reponseAccountDeactivated)},
128+
s: Scanner{client: common.ConstantResponseHttpClient(200, responseAccountDeactivated)},
129129
args: args{
130130
ctx: context.Background(),
131131
data: []byte(fmt.Sprintf("You can find a sentry super secret %s within", secret)),
@@ -142,7 +142,7 @@ func TestSentryToken_FromChunk(t *testing.T) {
142142
},
143143
{
144144
name: "found, account deactivated",
145-
s: Scanner{client: common.ConstantResponseHttpClient(200, responseEnmpty)},
145+
s: Scanner{client: common.ConstantResponseHttpClient(200, responseEmpty)},
146146
args: args{
147147
ctx: context.Background(),
148148
data: []byte(fmt.Sprintf("You can find a sentry super secret %s within", secret)),
@@ -209,8 +209,8 @@ const (
209209
}
210210
]
211211
`
212-
reponseAccountDeactivated = `{"detail": "Authentication credentials were not provided"}`
213-
responseEnmpty = `[]`
212+
responseAccountDeactivated = `{"detail": "Authentication credentials were not provided"}`
213+
responseEmpty = `[]`
214214
)
215215

216216
func BenchmarkFromData(benchmark *testing.B) {

pkg/detectors/sumologickey/sumologickey_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sumoKey2 = 'Khk3i2ugMxMgkb8bIA2auj4I8juZ3HiimDNssjzYdGqfizPZcxHK21a0LckgRSCL'`,
4444
want: []string{"CzrMhR8zzy1eH1F0XlY1tu5ywqa2yaSFoWGg2cqE43XkfnUVCytnPQfv1enUYrzv", "Khk3i2ugMxMgkb8bIA2auj4I8juZ3HiimDNssjzYdGqfizPZcxHK21a0LckgRSCL"},
4545
},
4646
{
47-
name: "invald pattern",
47+
name: "invalid pattern",
4848
input: "sumoId = 'doDkVYKjXZAwsz'",
4949
want: []string{},
5050
},

pkg/detectors/weightsandbiases/weightsandbiases_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ WANDB_API_KEY= 'eedf1c984f6b995ec40ecc6658356044847ffb32'`,
3030
want: []string{"eedf1c984f6b995ec40ecc6658356044847ffb31", "eedf1c984f6b995ec40ecc6658356044847ffb32"},
3131
},
3232
{
33-
name: "invald pattern",
33+
name: "invalid pattern",
3434
input: "WANDB_API_KEY = 'e84f6b995ec40ecc6658356044847ffb31'",
3535
want: []string{},
3636
},

pkg/sanitizer/utf8_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ func TestUTF8(t *testing.T) {
1919
want: "hello123",
2020
},
2121
{
22-
name: "santized",
22+
name: "sanitized",
2323
args: args{
2424
in: "Gr\351gory Smith",
2525
},
2626
want: "Gr❗gory Smith",
2727
},
2828
{
29-
name: "santized",
29+
name: "sanitized",
3030
args: args{
3131
in: "no \x00 nulls because postgres does not support it in text fields",
3232
},

pkg/sources/git/git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func TestSource_Chunks_Integration(t *testing.T) {
201201
"27fbead3bf883cdb7de9d7825ed401f28f9398f1-slack": {B: []byte("\n\n\nyup, just did that\n\ngithub_lol: \"ffc7e0f9400fb6300167009e42d2f842cd7956e2\"\n\noh, goodness. there's another one!\n")},
202202
"8afb0ecd4998b1179e428db5ebbcdc8221214432-": {B: []byte("Dustin <dustindecker@protonmail.com>\nDustin <dustindecker@protonmail.com>\nadd slack token\n")},
203203
"8afb0ecd4998b1179e428db5ebbcdc8221214432-slack": {B: []byte("oops might drop a slack token here\n\ngithub_secret=\"369963c1434c377428ca8531fbc46c0c43d037a0\"\n\nyup, just did that\n"), Multi: true},
204-
"8fe6f04ef1839e3fc54b5147e3d0e0b7ab971bd5-": {B: []byte("Dustin <dustindecker@protonmail.com>\nDustin <dustindecker@protonmail.com>\noops, accidently commited AWS token...\n")},
204+
"8fe6f04ef1839e3fc54b5147e3d0e0b7ab971bd5-": {B: []byte("Dustin <dustindecker@protonmail.com>\nDustin <dustindecker@protonmail.com>\noops, accidently commited AWS token...\n")}, //nolint:misspell
205205
"8fe6f04ef1839e3fc54b5147e3d0e0b7ab971bd5-aws": {B: []byte("blah blaj\n\nthis is the secret: AKIA2E0A8F3B244C9986\n\nokay thank you bye\n"), Multi: true},
206206
"84e9c75e388ae3e866e121087ea2dd45a71068f2-": {B: []byte("Dylan Ayrey <dxa4481@rit.edu>\nGitHub <noreply@github.com>\nUpdate aws\n")},
207207
"84e9c75e388ae3e866e121087ea2dd45a71068f2-aws": {B: []byte("\n\nthis is the secret: [Default]\nAccess key Id: AKIAILE3JG6KMS3HZGCA\nSecret Access Key: 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\n\nokay thank you bye\n"), Multi: false},

pkg/sources/github_experimental/object_discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const startingCharLen = 4
3939
// Max character length (6 is the default maximum)
4040
// 6 chars == 16M possibilities --> which will take 18k-55k queries.
4141
// that's really the max that's tolerable since it will take a long time to run.
42-
// If you increase this to accomdate a MASSIVE repository, it will take a long time to run.
42+
// If you increase this to accommodate a MASSIVE repository, it will take a long time to run.
4343
const maxCharLen = 6
4444

4545
// Starting GraphQL query chunk size.

0 commit comments

Comments
 (0)