Skip to content
Snippets Groups Projects
Commit 1778f88e authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Merge branch 'setup-pre-commit' into 'main'

Pre-commit: Setup codespell and gofmt

See merge request aura/tank!19
parents b9d5ca72 eb0d0aee
No related branches found
No related tags found
No related merge requests found
linters:
disable-all: true
enable:
- gofmt
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
args: ['--skip "*.js,*.map,*.sum"']
- repo: https://github.com/golangci/golangci-lint
rev: v1.57.2
hooks:
- id: golangci-lint
...@@ -29,7 +29,7 @@ endif ...@@ -29,7 +29,7 @@ endif
SWAG = $(GOPATH)/bin/swag SWAG = $(GOPATH)/bin/swag
SWAG_ARGS := -d api/v1/,cmd/tank/ -g api.go SWAG_ARGS := -d api/v1/,cmd/tank/ -g api.go
EXECUTEABLE := tank EXECUTABLE := tank
all: build all: build
.PHONY: vet format ui build clean distclean .PHONY: vet format ui build clean distclean
...@@ -37,6 +37,7 @@ all: build ...@@ -37,6 +37,7 @@ all: build
init.dev:: init.dev::
go get -u github.com/swaggo/swag/cmd/swag go get -u github.com/swaggo/swag/cmd/swag
go install github.com/swaggo/swag/cmd/swag@latest go install github.com/swaggo/swag/cmd/swag@latest
curl -sSfL https://github.com/pre-commit/pre-commit/releases/download/v3.7.0/pre-commit-3.7.0.pyz -o pre-commit.pyz && python3 pre-commit.pyz && rm -f pre-commit.pyz
vet: vet:
$(GOCMD) vet ./... $(GOCMD) vet ./...
...@@ -57,10 +58,10 @@ api-docs: ...@@ -57,10 +58,10 @@ api-docs:
# to allow building binary without generating api docs first, we put api/docs/docs.go under version control # to allow building binary without generating api docs first, we put api/docs/docs.go under version control
# see #30 # see #30
build: ui build: ui
$(GOCMD) build -o $(EXECUTEABLE) ./cmd/tank $(GOCMD) build -o $(EXECUTABLE) ./cmd/tank
dev: dev:
$(GOCMD) build -o $(EXECUTEABLE) -tags=dev ./cmd/tank $(GOCMD) build -o $(EXECUTABLE) -tags=dev ./cmd/tank
test-all: test-all:
gitlab-runner exec docker test-all gitlab-runner exec docker test-all
...@@ -69,7 +70,7 @@ coverage: ...@@ -69,7 +70,7 @@ coverage:
gitlab-runner exec docker test-all | grep 'ok.*of statements' gitlab-runner exec docker test-all | grep 'ok.*of statements'
clean: clean:
rm -f $(EXECUTEABLE) rm -f $(EXECUTABLE)
distclean: clean distclean: clean
rm -f ui/assets_vfsdata.go rm -f ui/assets_vfsdata.go
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment