Merge pull request #6431 from dokku/josegonzalez-patch-1
Add golanglint-ci testing support
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
install-go-devtools() {
|
install-go-devtools() {
|
||||||
go install github.com/go-delve/delve/cmd/dlv@latest
|
go install github.com/go-delve/delve/cmd/dlv@latest
|
||||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||||
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
}
|
}
|
||||||
|
|
||||||
setup-ci() {
|
setup-ci() {
|
||||||
|
|||||||
24
.golangci-lint.yml
Normal file
24
.golangci-lint.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
run:
|
||||||
|
timeout: 5m
|
||||||
|
|
||||||
|
linters:
|
||||||
|
disable-all: true
|
||||||
|
|
||||||
|
enable:
|
||||||
|
- errcheck
|
||||||
|
- goconst
|
||||||
|
- gocyclo
|
||||||
|
- gofumpt
|
||||||
|
- gosec
|
||||||
|
- gosimple
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- misspell
|
||||||
|
- revive
|
||||||
|
- staticcheck
|
||||||
|
- typecheck
|
||||||
|
- unconvert
|
||||||
|
- unparam
|
||||||
|
- unused
|
||||||
|
- whitespace
|
||||||
6
tests.mk
6
tests.mk
@@ -1,6 +1,7 @@
|
|||||||
SYSTEM := $(shell sh -c 'uname -s 2>/dev/null')
|
|
||||||
DOKKU_SSH_PORT ?= 22
|
DOKKU_SSH_PORT ?= 22
|
||||||
DOKKU_DOMAIN ?= dokku.me
|
DOKKU_DOMAIN ?= dokku.me
|
||||||
|
GO_PLUGINS := $(shell sh -c 'find plugins -type f -name "go.mod" -exec dirname "{}" \; | sort -u | sed -e "s/$$/\/.../" | xargs')
|
||||||
|
SYSTEM := $(shell sh -c 'uname -s 2>/dev/null')
|
||||||
|
|
||||||
bats:
|
bats:
|
||||||
ifeq ($(SYSTEM),Darwin)
|
ifeq ($(SYSTEM),Darwin)
|
||||||
@@ -130,6 +131,9 @@ lint-ci: lint-setup
|
|||||||
@echo linting...
|
@echo linting...
|
||||||
@cat tmp/shellcheck/test-files | xargs shellcheck | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $(shell cat tmp/shellcheck/exclude)
|
@cat tmp/shellcheck/test-files | xargs shellcheck | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $(shell cat tmp/shellcheck/exclude)
|
||||||
|
|
||||||
|
lint-golang:
|
||||||
|
golangci-lint run $(GO_PLUGINS)
|
||||||
|
|
||||||
lint-shfmt: shfmt
|
lint-shfmt: shfmt
|
||||||
# verifying via shfmt
|
# verifying via shfmt
|
||||||
# shfmt -l -bn -ci -i 2 -d .
|
# shfmt -l -bn -ci -i 2 -d .
|
||||||
|
|||||||
Reference in New Issue
Block a user