-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
golangci-lint: Upgrade, fix issues #397
Conversation
// 1. If string is not valid UTF-8, return it without splitting as | ||
// single item array. | ||
// 2) Assign all unicode characters into one of 4 sets: lower case | ||
// 2. Assign all unicode characters into one of 4 sets: lower case | ||
// letters, upper case letters, numbers, and all other characters. | ||
// 3) Iterate through characters of string, introducing splits | ||
// 3. Iterate through characters of string, introducing splits | ||
// between adjacent characters that belong to different sets. | ||
// 4) Iterate through array of split strings, and if a given string | ||
// 4. Iterate through array of split strings, and if a given string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was gofmt, not me.
@@ -47,7 +47,7 @@ func makeConfig(t *testing.T, config interface{}) (path string, cleanup func()) | |||
t.Helper() | |||
w, err := ioutil.TempFile("", "") | |||
assert.NoError(t, err) | |||
defer w.Close() // nolint: gosec | |||
defer w.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused //nolint
Thanks, but I prefer to use |
The golangci-lint being used was quite dated. This change upgrades to the latest version. Adds and updates exclusions based on new failures. Note on revive: I've included an opt-out for unused parameters for revive because turning `newThing(required bool)` to `newThing(_ bool)` is a loss of useful information. The changes to the Go files are to fix the following issues: ``` camelcase.go:16: File is not `gofmt`-ed with `-s` (gofmt) config_test.go:50:18: directive `//nolint: gosec` is unused for linter "gosec" (nolintlint) defaults_test.go:28:25: G601: Implicit memory aliasing in for loop. (gosec) doc.go:5: File is not `gofmt`-ed with `-s` (gofmt) kong.go:446:18: directive `//nolint: gosec` is unused for linter "gosec" (nolintlint) kong_test.go:503:20: G601: Implicit memory aliasing in for loop. (gosec) model.go:493:10: composites: reflect.ValueError struct literal uses unkeyed fields (govet) scanner.go:112: File is not `gofmt`-ed with `-s` (gofmt) ``` And to address broken nolint directives reported as follows by golangci-lint. ``` [.. skipped .. ] tag.go:65:1: directive `// nolint:gocyclo` should be written without leading space as `//nolint:gocyclo` (nolintlint) tag.go:206:51: directive `// nolint: gocyclo` should be written without leading space as `//nolint: gocyclo` (nolintlint) util_test.go:23:43: directive `// nolint: errcheck` should be written without leading space as `//nolint: errcheck` (nolintlint) util_test.go:51:22: directive `// nolint: errcheck` should be written without leading space as `//nolint: errcheck` (nolintlint) ```
3228d27
to
cf81d17
Compare
Fair enough. Brought the enable-all back. |
Thanks! |
The golangci-lint being used was quite dated.
This change upgrades to the latest version.
Adds and updates exclusions based on new failures.
Note on revive:
I've included an opt-out for unused parameters for revive
because turning
newThing(required bool)
tonewThing(_ bool)
is a loss of useful information.
The changes to the Go files are to fix the following issues:
And to address broken nolint directives reported as follows by
golangci-lint.