mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
golangci: enable 'gofmt'
This commit is contained in:
parent
62eecc8175
commit
fca1d61528
2 changed files with 9 additions and 13 deletions
|
@ -31,7 +31,7 @@ linters:
|
||||||
- goconst
|
- goconst
|
||||||
#- gocritic
|
#- gocritic
|
||||||
#- gocyclo
|
#- gocyclo
|
||||||
#- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
- golint
|
- golint
|
||||||
#- gomnd
|
#- gomnd
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -5,19 +5,15 @@ ifeq (, $(shell which golangci-lint))
|
||||||
$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")
|
$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: fmt lint test install_deps clean
|
.PHONY: lint test install_deps clean
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
all: fmt test
|
all: test
|
||||||
|
|
||||||
fmt:
|
install_deps:
|
||||||
$(info ******************** checking formatting ********************)
|
$(info ******************** downloading dependencies ********************)
|
||||||
@test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1)
|
go get -v ./...
|
||||||
|
|
||||||
lint:
|
|
||||||
$(info ******************** running lint tools ********************)
|
|
||||||
golangci-lint run -v
|
|
||||||
|
|
||||||
test: install_deps
|
test: install_deps
|
||||||
$(info ******************** running tests ********************)
|
$(info ******************** running tests ********************)
|
||||||
|
@ -27,9 +23,9 @@ richtest: install_deps
|
||||||
$(info ******************** running tests with kyoh86/richgo ********************)
|
$(info ******************** running tests with kyoh86/richgo ********************)
|
||||||
richgo test -v ./...
|
richgo test -v ./...
|
||||||
|
|
||||||
install_deps:
|
lint:
|
||||||
$(info ******************** downloading dependencies ********************)
|
$(info ******************** running lint tools ********************)
|
||||||
go get -v ./...
|
golangci-lint run -v
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BIN)
|
rm -rf $(BIN)
|
||||||
|
|
Loading…
Reference in a new issue