-
Notifications
You must be signed in to change notification settings - Fork 5
/
Taskfile.yaml
73 lines (72 loc) · 2.33 KB
/
Taskfile.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# https://taskfile.dev
version: '3'
vars:
GO_PACKAGES:
sh: go list ./...
TAG:
sh: git describe --tags --abbrev=0
tasks:
install:
desc: Installs fname
cmds:
- go install -v -ldflags "-w -s -X main.version={{.TAG}}" ./cmd/fname
lint:
desc: Runs golangci-lint
cmds:
- golangci-lint run
test:
desc: Runs tests
cmds:
- go test ./...
release:test:
desc: Tests release process without publishing
cmds:
- goreleaser --snapshot --clean
data:dupe:
desc: Checks dictionary data for duplicate entries
cmds:
- cat data/adjective | uniq -d
- cat data/adverb | uniq -d
- cat data/noun | uniq -d
- cat data/verb | uniq -d
data:spellcheck:
desc: Checks dictionary data for spelling errors
cmds:
- aspell -d en_US --ignore-case -c data/adjective
- aspell -d en_US --ignore-case -c data/adverb
- aspell -d en_US --ignore-case -c data/noun
- aspell -d en_US --ignore-case -c data/verb
data:count:
desc: Counts dictionary data
cmds:
- wc -l data/adjective | cut -F 1
- wc -l data/adverb | cut -F 1
- wc -l data/noun | cut -F 1
- wc -l data/verb | cut -F 1
data:lowercase:
desc: Converts dictionary data to lowercase
cmds:
- cat data/adjective | tr '[:upper:]' '[:lower:]' > data/adjective.tmp
- mv data/adjective.tmp data/adjective
- cat data/adverb | tr '[:upper:]' '[:lower:]' > data/adverb.tmp
- mv data/adverb.tmp data/adverb
- cat data/noun | tr '[:upper:]' '[:lower:]' > data/noun.tmp
- mv data/noun.tmp data/noun
- cat data/verb | tr '[:upper:]' '[:lower:]' > data/verb.tmp
- mv data/verb.tmp data/verb
data:sort:
desc: Sorts dictionary data
cmds:
- sort data/adjective | uniq > data/adjective.tmp
- sort data/adverb | uniq > data/adverb.tmp
- sort data/noun | uniq > data/noun.tmp
- sort data/verb | uniq > data/verb.tmp
- mv data/adjective.tmp data/adjective
- mv data/adverb.tmp data/adverb
- mv data/noun.tmp data/noun
- mv data/verb.tmp data/verb
data:trim:
desc: Trims dictionary data of whitespace
cmds:
- sed -i "/\S/!d" data/adjective data/adverb data/noun data/verb # newlines
- sed -i "s/[ \t]*$//" data/adjective data/adverb data/noun data/verb # trailing whitespace