-
Notifications
You must be signed in to change notification settings - Fork 4
/
Taskfile.yml
45 lines (36 loc) · 951 Bytes
/
Taskfile.yml
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
# https://taskfile.dev/#/installation
version: '3'
silent: true
tasks:
default:
cmds:
- task: tools:install
- task: tidy
- task: fmt
- task: lint
tools:install:
- echo "Install local tools..."
- (which gci > /dev/null) || GO111MODULE=off go install github.com/daixiang0/gci
- (which gofumpt > /dev/null) || GO111MODULE=off go install mvdan.cc/gofumpt
tidy:
cmds:
- echo "Tidy..."
- go mod tidy
fmt:
cmds:
- echo "Fmt..."
- gofumpt -w .
- gci write -s standard -s default -s "Prefix(github.com/golang-ninja-courses/defer-panic-mastery)" . 2> /dev/null
lint:
cmds:
- task: lint:examples
- task: lint:tasks
lint:examples:
- echo "Lint examples..."
- golangci-lint run ./examples/...
lint:tasks:
- echo "Lint tasks..."
- golangci-lint run ./tasks/...
lint:dir:
- echo "Lint..."
- golangci-lint run {{.CLI_ARGS}}