Followup to "Add golangci-lint config file"

Addressed comments by @ldez and added `lint-fix` target.

Signed-off-by: Ramsés Morales <ramses@gmail.com>
This commit is contained in:
Ramsés Morales 2022-07-22 12:05:42 -07:00
parent a7a48168a0
commit 3cdc4225e1
2 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,5 @@
run:
go: '1.17'
timeout: 30m
skip-files:
- "^zz_generated.*"
@ -27,15 +28,10 @@ linters:
linters-settings: # please keep this alphabetized
staticcheck:
go: "1.17"
checks: [
"all",
"-SA1019", # TODO(fix) Using a deprecated function, variable, constant or field
"-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isnt allowed
]
checks:
- "all"
- "-SA1019" # TODO(fix) Using a deprecated function, variable, constant or field
- "-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isnt allowed
stylecheck:
checks: [
"ST1019", # Importing the same package multiple times.
]
unused:
go: "1.17"
checks:
- "ST1019" # Importing the same package multiple times.

View File

@ -167,6 +167,10 @@ push-docker-release-main:
$(info ETCD_VERSION: $(ETCD_VERSION))
docker push gcr.io/etcd-development/etcd:$(ETCD_VERSION)
# Recursively analyzes the tree:
lint:
# Recursively analyzes the tree:
golangci-lint -v run
golangci-lint run
# Fixes found issues, if supported by the linter:
lint-fix:
golangci-lint run --fix