From 2aca6e87dcf04ee95095430d40ab72e83546630e Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 4 Sep 2019 23:31:23 +0200 Subject: [PATCH] Added lint --- .drone.yml | 1 + Makefile | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index ce9ea9d..0a0275f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,7 @@ steps: image: vikunja/golang-build:latest pull: true commands: + - make lint - make build when: event: [ push, tag, pull_request ] diff --git a/Makefile b/Makefile index 98e1eb6..a21f5d0 100644 --- a/Makefile +++ b/Makefile @@ -122,4 +122,11 @@ release-copy: .PHONY: release-check release-check: - cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;) \ No newline at end of file + cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;) + +.PHONY: lint +lint: + @hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + go install $(GOFLAGS) golang.org/x/lint/golint; \ + fi + for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;