Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
whonion committed Jun 21, 2023
1 parent b99af0f commit 8ae5f73
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ coverage-go-routine: ## Run coverage for go-routine.go
$(GOCMD) tool cover -func profile-go-routine.cov

## Lint:
Lint: lint-dockerfile lint-yaml lint-go ## Run all available lint
Lint: lint-dockerfile lint-yaml lint-go-main lint-go-routine ## Run all available lint

lint-dockerfile: ## Lint your Dockerfile
# If the Dockerfile is present, we lint it.
Expand All @@ -77,9 +77,13 @@ ifeq ($(shell test -e ./Dockerfile && echo -n yes),yes)
docker run --rm -i $(CONFIG_OPTION) hadolint/hadolint hadolint $(OUTPUT_OPTIONS) - < ./Dockerfile $(OUTPUT_FILE)
endif

lint-go: ## Use golangci-lint in your project
$(eval OUTPUT_OPTIONS = $(shell [ "${EXPORT_RESULT}" == "true" ] && echo "--out-format checkstyle ./... | tee /dev/tty > checkstyle-report.xml" || echo "" ))
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest-alpine golangci-lint run --deadline=65s $(OUTPUT_OPTIONS) main.go go-routine.go
lint-go-main: ## Use golangci-lint for main.go
$(eval OUTPUT_OPTIONS = $(shell [ "${EXPORT_RESULT}" == "true" ] && echo "--out-format checkstyle main.go | tee /dev/tty > checkstyle-report-main.xml" || echo "" ))
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest-alpine golangci-lint run --deadline=65s $(OUTPUT_OPTIONS) main.go

lint-go-routine: ## Use golangci-lint for go-routine.go
$(eval OUTPUT_OPTIONS = $(shell [ "${EXPORT_RESULT}" == "true" ] && echo "--out-format checkstyle go-routine.go | tee /dev/tty > checkstyle-report-goroutine.xml" || echo "" ))
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest-alpine golangci-lint run --deadline=65s $(OUTPUT_OPTIONS) go-routine.go

lint-yaml: ## Use yamllint in the yaml files of your projects
ifeq ($(EXPORT_RESULT), true)
Expand All @@ -89,6 +93,7 @@ endif
docker run --rm -v $(shell pwd):/data cytopia/yamllint -f parsable $(shell git ls-files '*.yml' '*.yaml') $(OUTPUT_OPTIONS)



## Help:
help: ## Show this help.
@echo ''
Expand Down

0 comments on commit 8ae5f73

Please sign in to comment.