From f92f73b0ffb93544625a721dcacab5c80625bce0 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 18 Jun 2022 20:58:53 +0200 Subject: [PATCH] chore: added Makefile & ci linting --- .gitignore | 2 ++ .woodpecker/.lint.yml | 13 +++++++++++++ Makefile | 31 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .woodpecker/.lint.yml create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 140f8cf..936332c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.so + +_docs/ diff --git a/.woodpecker/.lint.yml b/.woodpecker/.lint.yml new file mode 100644 index 0000000..31df08c --- /dev/null +++ b/.woodpecker/.lint.yml @@ -0,0 +1,13 @@ +branches: + exclude: [ main ] + +platform: 'linux/amd64' + +pipeline: + lint: + image: 'chewingbever/vlang:latest' + pull: true + commands: + - make lint + when: + event: [ push ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..81b65fc --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +# =====CONFIG===== +V_PATH ?= v +V := $(V_PATH) -showcc + +all: vdocker + + +# =====COMPILATION===== +.PHONY: vdocker +vdocker: + $(V) -g -shared . + + +# =====DOCS===== +.PHONY: api-docs +api-docs: + rm -rf '_docs' + v doc -f html -m -readme . + + +# =====OTHER===== +.PHONY: lint +lint: + $(V) fmt -verify . + $(V) vet -W . + $(V_PATH) missdoc -p . + @ [ $$($(V_PATH) missdoc -p . | wc -l) = 0 ] + +.PHONY: fmt +fmt: + $(V) fmt -w .