diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 00000000000..cd2a9e8293d --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,9 @@ +--- +# Built from docs https://yamllint.readthedocs.io/en/stable/configuration.html +extends: default + +rules: + # 120 chars should be enough, but don't fail if a line is longer + line-length: + max: 120 + level: warning diff --git a/Makefile b/Makefile index 6d855e3be46..c649f6f544b 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,12 @@ help: Makefile @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' .PHONY: help +## clean: clean testcache +clean: + @echo "--> Clearing testcache" + @go clean --testcache +.PHONY: clean + ## cover: generate to code coverage report. cover: @echo "--> Generating Code Coverage" @@ -14,6 +20,19 @@ cover: @go-acc -o coverage.txt `go list ./...` .PHONY: cover +## lint: Run linters golangci-lint and markdownlint. +lint: + @echo "--> Running golangci-lint" + @golangci-lint run + @echo "--> Running markdownlint" + @markdownlint --config .markdownlint.yaml '**/*.md' + @echo "--> Running hadolint" + @hadolint docker/mockserv.Dockerfile + @echo "--> Running yamllint" + @yamllint --no-warnings . -c .yamllint.yml + +.PHONY: lint + ## test-unit: Running unit tests test-unit: @echo "--> Running unit tests" @@ -23,9 +42,15 @@ test-unit: ## test-unit-race: Running unit tests with data race detector test-unit-race: @echo "--> Running unit tests with data race detector" - @go test -race `go list ./...` + @go test -race -count=1 `go list ./...` .PHONY: test-unit-race +### test-all: Run tests with and without data race +test-all: + @$(MAKE) test-unit + @$(MAKE) test-unit-race +.PHONY: test-all + ## proto-gen: Generate protobuf files. Requires docker. proto-gen: @echo "--> Generating Protobuf files"