Define Makefile with golangci-lint
As govet and gofmt are now handled by golangci-lint, there is no need to apply them here. Install golangci-lint Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
2cfe79728d
commit
b7d75ff4da
|
|
@ -21,6 +21,9 @@ jobs:
|
|||
with:
|
||||
format: auto
|
||||
- uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
args: --verbose
|
||||
version: v1.51.2
|
||||
build:
|
||||
name: Build all linux architectures
|
||||
needs: lint
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
GOLANGCI_LINT_VERSION="v1.51.2"
|
||||
|
||||
go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}"
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
.PHONY: lint
|
||||
lint: golangci/install golangci/lint
|
||||
|
||||
.PHONY: golangci/install
|
||||
golangci/install:
|
||||
./mk/dependencies/golangci.sh
|
||||
|
||||
.PHONY: golangci/lint
|
||||
golangci/lint:
|
||||
golangci-lint run --verbose
|
||||
|
||||
.PHONY: golangci/fix
|
||||
golangci/fix:
|
||||
golangci-lint run --verbose --fix
|
||||
16
test.sh
16
test.sh
|
|
@ -20,22 +20,6 @@ else
|
|||
go test ${PKGS}
|
||||
fi
|
||||
|
||||
GO_FILES=$(find . -name '*.go' -type f -print)
|
||||
|
||||
echo "Checking gofmt..."
|
||||
fmtRes=$(gofmt -d -e -s ${GO_FILES})
|
||||
if [ -n "${fmtRes}" ]; then
|
||||
echo -e "go fmt checking failed:\n${fmtRes}"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
echo "Checking govet..."
|
||||
vetRes=$(go vet ${PKGS})
|
||||
if [ -n "${vetRes}" ]; then
|
||||
echo -e "go vet checking failed:\n${vetRes}"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
echo "Checking license header..."
|
||||
licRes=$(
|
||||
for file in $(find . -type f -iname '*.go'); do
|
||||
|
|
|
|||
Loading…
Reference in New Issue