fix: add misspell check for linting codebase (#3865)

* add misspell check

* lint: fix misspell issues

```
server/events/vcs/instrumented_client.go:46:26: `soley` is a misspelling of `solely` (misspell)
// methods and implement soley any github specific interfaces.
                         ^
server/events/project_command_context_builder.go:49:5: `Conciously` is a misspelling of `Consciously` (misspell)
	// Conciously making this global since it gets flushed periodically anyways
	   ^
server/controllers/events/gitlab_request_parser_validator.go:87:32: `noteable` is a misspelling of `notable` (misspell)
				NoteableType string `json:"noteable_type"`
				                           ^
server/controllers/events/gitlab_request_parser_validator_test.go:351:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_type": "MergeRequest",
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:359:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_id": 7,
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:467:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_type": "Commit",
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:475:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_id": null,
     ^
server/events/event_parser_test.go:1012:23: `seperate` is a misspelling of `separate` (misspell)
	// If sha changes in seperate PR,
	                     ^
```

Signed-off-by: Rui Chen <rui@chenrui.dev>

* add locale setting

Signed-off-by: Rui Chen <rui@chenrui.dev>

* Revert "lint: fix misspell issues"

This reverts commit 7cc56afa8e.

* lint: fix some misspell issues

Signed-off-by: Rui Chen <rui@chenrui.dev>

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
This commit is contained in:
Rui Chen
2023-10-16 16:17:57 -04:00
committed by GitHub
parent 16c373d211
commit 23b373e8a6
4 changed files with 15 additions and 6 deletions

View File

@@ -1,14 +1,23 @@
linters-settings:
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
# locale: US
ignore-words:
# for gitlab notes api
- noteable
linters:
enable:
- errcheck
- gochecknoinits
# We don't use goconst because it gives false positives in the tests.
# - goconst
- gofmt
- revive
- gosec
- gosimple
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unconvert

View File

@@ -1009,7 +1009,7 @@ func TestBitBucketNonCodeChangesAreIgnored(t *testing.T) {
act = parser.GetBitbucketCloudPullEventType("pullrequest:updated", "fakeSha2", "https://github.com/fakeorg/fakerepo/pull/1")
Equals(t, models.UpdatedPullEvent, act)
// If sha changes in seperate PR,
// If sha changes in separate PR,
act = parser.GetBitbucketCloudPullEventType("pullrequest:updated", "otherPRSha", "https://github.com/fakeorg/fakerepo/pull/2")
Equals(t, models.UpdatedPullEvent, act)
// We will still ignore same shas in first PR

View File

@@ -46,7 +46,7 @@ type ProjectCommandContextBuilder interface {
// object relevant to the command it applies to.
type CommandScopedStatsProjectCommandContextBuilder struct {
ProjectCommandContextBuilder
// Conciously making this global since it gets flushed periodically anyways
// Consciously making this global since it gets flushed periodically anyways
ProjectCounter tally.Counter
}

View File

@@ -43,7 +43,7 @@ type IGithubClient interface {
}
// InstrumentedGithubClient should delegate to the underlying InstrumentedClient for vcs provider-agnostic
// methods and implement soley any github specific interfaces.
// methods and implement solely any github specific interfaces.
type InstrumentedGithubClient struct {
*InstrumentedClient
PullRequestGetter GithubPullRequestGetter