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

View File

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