Run staticcheck as part of GitHub CI
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Check Warewulf code with golang linter (golang ${{ matrix.go-version }})
|
||||
run: make lint
|
||||
run: make lint staticcheck
|
||||
|
||||
vet:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Document `warewulf.conf:dhcp.template`. #1701
|
||||
- New template field `IpCIDR`. #1700
|
||||
- `wwctl configure` persists auto-detected server network settings to `warewulf.conf`. #1700
|
||||
- Run staticcheck as part of GitHub CI. #1657
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
4
Makefile
4
Makefile
@@ -69,6 +69,10 @@ etc/bash_completion.d/wwctl: wwctl
|
||||
lint: $(config)
|
||||
$(GOLANGCI_LINT) run --build-tags "$(WW_GO_BUILD_TAGS)" --timeout=5m ./...
|
||||
|
||||
.PHONY: staticcheck
|
||||
staticcheck: $(GOLANG_STATICCHECK) $(config)
|
||||
$(GOLANG_STATICCHECK) ./...
|
||||
|
||||
.PHONY: deadcode
|
||||
deadcode: $(config)
|
||||
$(GOLANG_DEADCODE) -test ./...
|
||||
|
||||
5
Tools.mk
5
Tools.mk
@@ -11,6 +11,8 @@ GOLANG_DEADCODE := $(TOOLS_BIN)/deadcode
|
||||
|
||||
GOLANG_LICENSES := $(TOOLS_BIN)/go-licenses
|
||||
|
||||
GOLANG_STATICCHECK := $(TOOLS_BIN)/staticcheck
|
||||
|
||||
PROTOC := $(TOOLS_BIN)/protoc
|
||||
PROTOC_GEN_GO := $(TOOLS_BIN)/protoc-gen-go
|
||||
PROTOC_GEN_GO_GRPC := $(TOOLS_BIN)/protoc-gen-go-grpc
|
||||
@@ -56,6 +58,9 @@ $(PROTOC_GEN_GO_GRPC):
|
||||
$(GOLANG_LICENSES):
|
||||
GOBIN="$(PWD)/$(TOOLS_BIN)" go install github.com/google/go-licenses@v1.6.0
|
||||
|
||||
$(GOLANG_STATICCHECK):
|
||||
GOBIN="$(PWD)/$(TOOLS_BIN)" go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
|
||||
.PHONY: cleantools
|
||||
cleantools:
|
||||
rm -rf $(TOOLS_DIR)
|
||||
|
||||
Reference in New Issue
Block a user