Skip to content

Commit

Permalink
fix: [#100] Prevent code duplication by using a Taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-bvanb committed Oct 28, 2024
1 parent e71eb4b commit 815c375
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
version: "3"

vars:
GCI_VERSION: 0.13.5
GOLANGCI_LINT_VERSION: 1.61.0

tasks:
gci:
silent: true
cmds:
- |
if ! ~/go/bin/gci --version | grep "gci version {{.GCI_VERSION}}"; then
go install github.com/daixiang0/gci@v{{.GCI_VERSION}}
fi
~/go/bin/gci write --skip-generated -s standard -s default .
golangci-lint-install:
silent: true
cmds:
- |
if ! golangci-lint --version | grep "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
golangci-lint:
silent: true
cmds:
- task: golangci-lint-install
- task: golangci-lint-run
golangci-lint-without-cache:
silent: true
cmds:
- task: golangci-lint-install
- golangci-lint cache clean
- task: golangci-lint-run
lint:
silent: true
deps:
- task: gci
- task: golangci-lint

0 comments on commit 815c375

Please sign in to comment.