diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..e1ad107 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,33 @@ +--- +version: "3" + +vars: + GOLANGCI_LINT_VERSION: 1.61.0 + +tasks: + golangci-lint-install: + silent: true + cmds: + - | + if ! golangci-lint --version | grep -q "has version {{.GOLANGCI_LINT_VERSION}}"; then + curl \ + -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |\ + sh -s -- -b $(go env GOPATH)/bin v{{.GOLANGCI_LINT_VERSION}} + fi + golangci-lint-run: + silent: true + cmds: + - | + golangci-lint run \ + -v + lint: + silent: true + cmds: + - task: golangci-lint-install + - task: golangci-lint-run + lint-without-cache: + silent: true + cmds: + - task: golangci-lint-install + - golangci-lint cache clean + - task: golangci-lint-run