Skip to content

Commit

Permalink
fix: add misspell check for linting codebase (#3865)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* add locale setting

Signed-off-by: Rui Chen <[email protected]>

* Revert "lint: fix misspell issues"

This reverts commit 7cc56af.

* lint: fix some misspell issues

Signed-off-by: Rui Chen <[email protected]>

---------

Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: PePe Amengual <[email protected]>
  • Loading branch information
chenrui333 and jamengual authored Oct 16, 2023
1 parent 16c373d commit 23b373e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/events/event_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/events/project_command_context_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion server/events/vcs/instrumented_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23b373e

Please sign in to comment.