generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
158 lines (126 loc) · 3.29 KB
/
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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
# dependencies:
# - ginkgo
# - goi18n
# - golangci-lint
# - goveralls
# - yamllint
version: "3"
silent: true
dotenv: [".env"]
tasks:
# === build ================================================
b:
cmds:
- go build ./...
# === test =================================================
t:
cmds:
- go test ./...
ti:
cmds:
- go test ./i18n
dry:
cmds:
- ginkgo -v --dry-run ./...
# === ginkgo ================================================
# initialise a test suite for a package. (only 1 per package)
boot:
cmds:
- ginkgo bootstrap
# run tests suites recursive
g:
cmds:
- ginkgo -r
# invoke as task gen -- <item>
gl:
cmds:
- ginkgo -r --label-filter={{.CLI_ARGS}}
# run tests suites recursive with verbose
gv:
cmds:
- ginkgo -r -v
# generate a test file for the item provided (item_test.go)
# invoke as task gen -- <item>
gen:
cmds:
- ginkgo generate {{.CLI_ARGS}}
# === watch ================================================
watchv:
cmds:
- ginkgo watch -v -r -p ./...
watchvc:
cmds:
- ginkgo watch -v -r -p ./collections
watchvi:
cmds:
- ginkgo watch -v -r -p ./i18n
watch:
cmds:
- ginkgo watch -r -p ./...
# === lint =================================================
lint:
cmds:
- golangci-lint run
linty:
cmds:
- yamllint *.y*ml
# === coverage =============================================
publish-cover:
cmds:
- goveralls -repotoken {{.COVERALLS_TOKEN}}
cover:
cmds:
- ginkgo --json-report
./ginkgo.report
-coverpkg=./...
-coverprofile=./coverage/coverage.out -r
# === i18n =================================================
clear:
cmds:
- rm ./i18n/out/* --recursive
# extract i18m messages
extract:
cmds:
- goi18n extract
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out/l10n
# new translation
newt:
deps: [extract]
cmds:
- touch ./i18n/out/l10n/translate.en-US.json
# derive a translation from the default
merge:
cmds:
- goi18n merge
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out
./i18n/out/active.en-GB.json ./i18n/out/l10n/translate.en-US.json
# update existing translations
# after running this task, the translation file generated will
# contain only the new translations. Update the active file,
# with the new translations. Also, need to copy the default
# file (active.en-GB.json) back into ./i18n/default
update:
deps: [extract]
cmds:
- goi18n merge
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out
./i18n/out/active.en-GB.json ./i18n/deploy/active.en-US.json
# run this after manual translation has occurred to integrate it
# back into the translation file. Unfortunately, this task doesn't
# work properly, because it does not include the hashes. Without
# this task, the new translations must be manually added to the active
# translation file (active.en-US.json).
accept:
cmds:
- goi18n merge
-format json
-sourceLanguage "en-US"
-outdir ./i18n/temp
./i18n/out/translate.en-US.json ./i18n/deploy/active.en-US.json