-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
47 lines (41 loc) · 1020 Bytes
/
Taskfile.yml
File metadata and controls
47 lines (41 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# https://taskfile.dev
version: "3"
vars:
GOLANGCI_LINT_VERSION: v2.10.1
GO_VERSION: "1.25.0"
LINT_IMAGE: "golangci/golangci-lint:{{.GOLANGCI_LINT_VERSION}}"
tasks:
test:
desc: Run all tests
dir: .
cmds:
- go test ./...
lint:
desc: Run golangci-lint inside a Docker container
dir: .
cmds:
- >-
docker run --rm
-v {{.ROOT_DIR}}:/workspace
-w /workspace
-e GOFLAGS=-buildvcs=false
-e GOLANGCI_LINT_CACHE=/tmp/.golangci-lint-cache
{{.LINT_IMAGE}}
golangci-lint run ./...
lint:fix:
desc: Run golangci-lint with auto-fix inside a Docker container
dir: .
cmds:
- >-
docker run --rm
-v {{.ROOT_DIR}}:/workspace
-w /workspace
-e GOFLAGS=-buildvcs=false
-e GOLANGCI_LINT_CACHE=/tmp/.golangci-lint-cache
{{.LINT_IMAGE}}
golangci-lint run --fix ./...
check:
desc: Run all checks (lint + test)
cmds:
- task: lint
- task: test