Compare commits

..

443 Commits

Author SHA1 Message Date
Andrey Nering
1f477eb456 v3.34.1 2024-01-27 18:49:00 -03:00
Pete Davison
870c07eafb fix: remote prompt (#1487) 2024-01-27 18:45:13 -03:00
Andrey Nering
6682489967 v3.34.0 2024-01-25 21:43:38 -03:00
Pete Davison
d5b42e97ec refactor: use tf for taskfile instead of t 2024-01-25 21:23:28 -03:00
Pete Davison
d6b2926828 refactor: move task merge code into a method 2024-01-25 21:23:28 -03:00
Pete Davison
909ec1ed0f refactor: convert taskfile.Merge into a method 2024-01-25 21:23:28 -03:00
Andrey Nering
672e0198f9 chore: add changelog for #1478 2024-01-25 21:17:01 -03:00
Pete Davison
e9392df30b fix: experiment flags not working when .env is not in cwd (#1478) 2024-01-25 21:15:02 -03:00
Andrey Nering
d0efc1c5cd chore: add changelog for #1469 2024-01-25 21:12:37 -03:00
Pete Davison
3ff8fdbc0a feat: add ROOT_TASKFILE special variable (#1469) 2024-01-25 21:11:08 -03:00
Andrey Nering
6ebe2e765f chore: add changelog for #1465 2024-01-25 21:08:05 -03:00
Pete Davison
fa82051a06 fix: tests 2024-01-25 21:05:23 -03:00
Pete Davison
90a56df621 feat: update schema to accept semver strings 2024-01-25 21:05:23 -03:00
Pete Davison
26e79121f9 refactor: consistent naming for errors 2024-01-25 21:05:23 -03:00
Pete Davison
e2b85c6aa1 feat: version checks 2024-01-25 21:05:23 -03:00
Andrey Nering
8c0236c795 chore: fix typo on changelog 2024-01-25 21:01:26 -03:00
Andrey Nering
63ec83b8f7 chore: add changelog for #1482 2024-01-25 20:59:19 -03:00
Shaun Tabone
1b146543c5 fix(completions): support lowercase filename for Taskfile (#1482) 2024-01-25 20:57:21 -03:00
Andrey Nering
9ee0ea6ad1 chore: add changelog for #1476 2024-01-19 18:06:42 -03:00
Stephen Rosen
b377ddebff chore: add linting CI step for the JSON Schema
This is written to use `check-jsonschema` on the (current) latest
version (0.27.3).

It checks that the JSON Schema published in the docs is valid
under its declared metaschema (`$schema`).
2024-01-19 18:03:51 -03:00
Stephen Rosen
d6b9b30804 fix: malformed defer definition in JSON Schema
The `defer` definition listed `"string"` where `{"type":"string"}`
was wanted.
2024-01-19 18:03:51 -03:00
Stephen Rosen
149f6fe233 refactor: dedent JSON Schema 'definitions'
The default git diff algorithm isn't great at showing this because
it incorrectly matches some closing blocks against other, distant,
closing blocks. But this is all just a two-space dedent.
2024-01-19 18:03:51 -03:00
Stephen Rosen
0488a80ace fix: remove "versioning" from jsonschema defs
This removes the "3" nested in `definitions` which makes the contents
of `definitions` pass JSON Schema metaschema validation even when the
contents are not valid subschemas. `definitions` SHOULD contain
subschemas as its values, with no intermediate keys. (This is a MUST
in later JSON Schema spec versions, in which the key switches from
`definitions` to `$defs` as a related change.)

The contents are intentionally *not* dedented to make review easier.
2024-01-19 18:03:51 -03:00
task-bot
2cb68aff8b chore: sync translations (#1466) 2024-01-18 15:26:38 -03:00
Pete Davison
f1e2fee088 docs: improvements/corrections to experiments doc 2024-01-17 10:53:51 +00:00
Pete Davison
dc3cf1cb16 chore: changelog for #1438, #1464 2024-01-11 16:02:52 +00:00
Pete Davison
94aaea390f feat: merge template func should support variadic list of maps (#1464) 2024-01-11 16:00:52 +00:00
Pete Davison
40b6150030 chore: changelog 2024-01-11 15:12:11 +00:00
Pete Davison
dbc120c970 feat: support refs in dependencies 2024-01-11 14:44:04 +00:00
Pete Davison
25b1966506 feat: resolve variables in vars declarations too 2024-01-11 14:44:04 +00:00
Pete Davison
bff0a0a3d4 feat: updated schema.json 2024-01-11 14:44:04 +00:00
Pete Davison
b495a6bd0b docs: added docs for any variables proposal 2 2024-01-11 14:44:04 +00:00
Pete Davison
98ea907284 fix: bug where silent value was not deep copied on dependencies 2024-01-11 14:44:04 +00:00
Pete Davison
1f3fca50b3 feat: add ability to call task with variable by reference 2024-01-11 14:44:04 +00:00
Pete Davison
c655d90ab3 feat: add json and yaml variable constructors 2024-01-11 14:44:04 +00:00
Pete Davison
2ccf80713d feat: add sh and map (value) support 2024-01-11 14:44:04 +00:00
Pete Davison
d87e7981fb fix: don't report errors when fast compiling 2024-01-11 14:44:04 +00:00
Pete Davison
dfe39bfb5d feat: support multiple experiment values 2024-01-11 14:44:04 +00:00
Pete Davison
f6a24fe925 feat: added basic merge template function (#1438) 2024-01-11 14:29:14 +00:00
Pete Davison
d2522a6d9d fix: getSpecialVars 2024-01-11 14:00:30 +00:00
Pete Davison
e734e29009 refactor: move prompts into consts 2024-01-11 14:00:30 +00:00
Pete Davison
3b5fbf94f7 refactor: split read.go into taskfile.go and reader.go 2024-01-11 14:00:30 +00:00
Pete Davison
7cb45a23b6 refactor: orderedmap package -> omap 2024-01-11 14:00:30 +00:00
Pete Davison
1a03c3fbaf feat: includes should use OrderedMap 2024-01-11 14:00:30 +00:00
Pete Davison
d684e59b6a feat: store namespace directly in include 2024-01-11 14:00:30 +00:00
Pete Davison
5fc66293b0 refactor: IncludedTaskfiles -> Includes 2024-01-11 14:00:30 +00:00
Andrey Nering
bb16c3efca docs: document joinPath and relPath template functions 2024-01-10 22:28:11 -03:00
task-bot
f108fdd580 chore: sync translations (#1440) 2024-01-11 01:19:58 +00:00
Andrey Nering
33f90a8c16 chore: add changelog and documentation for #1452 2024-01-10 22:12:19 -03:00
Pete Davison
00896a1318 feat: add spew function to templater (#1452) 2024-01-10 22:04:45 -03:00
Andrey Nering
d797836cb8 chore(deps): upgrade x/exp/slices (#1462) 2024-01-11 01:02:05 +00:00
Andrey Nering
7393821d64 chore: add changelog for #1459 2024-01-10 21:40:10 -03:00
Pete Davison
42af0fc791 feat: invert call.Direct (#1459) 2024-01-10 21:32:49 -03:00
dependabot[bot]
07e6f5cad7 chore(deps): bump golang.org/x/term from 0.15.0 to 0.16.0 (#1458) 2024-01-11 00:31:24 +00:00
dependabot[bot]
334fd39e95 chore(deps): bump follow-redirects from 1.15.3 to 1.15.4 in /docs (#1461) 2024-01-11 00:30:32 +00:00
dependabot[bot]
c199aaeac9 chore(deps): bump tj-actions/changed-files in /.github/workflows (#1454) 2024-01-10 21:28:14 -03:00
dependabot[bot]
b4a7ad4fbe chore(deps): bump golang.org/x/sync from 0.5.0 to 0.6.0 (#1457) 2024-01-10 21:27:31 -03:00
Pete Davison
19bf2c2d48 fix: broken link in experiment auto-commenter 2023-12-31 02:15:40 +00:00
Pete Davison
61c0c32c2a fix: find and replace mistake 2023-12-29 20:42:30 +00:00
Pete Davison
bc88ad0de2 chore: changelog 2023-12-29 20:42:15 +00:00
Pete Davison
247c2586c2 refactor: taskfile/ast package (#1450)
* refactor: ast package

* feat: read -> taskfile

* refactor: taskfile.Taskfile -> taskfile.Read

* refactor: move merge function back into taskfile package

* refactor: rename taskfile.go to read.go
2023-12-29 20:32:03 +00:00
Pete Davison
2b67d05b9d feat: remove v2 support (#1447)
* feat: remove v2 support

* docs: update v2 schema docs
2023-12-29 20:26:02 +00:00
Pete Davison
212ff42304 docs: improved experimental docs formatting (#1445)
* docs: remove section from styleguide

* docs: update format of experiments/deprecations docs
2023-12-29 20:24:23 +00:00
Andrey Nering
b11be9d079 style: remove unneeded white space 2023-12-29 15:13:01 -03:00
Pete Davison
685a6f36d9 fix: only attempt to attach ad if sidebar ad container exists 2023-12-25 22:44:38 +00:00
Pete Davison
c569cbc220 chore(readme): fix another typo on link 2023-12-22 00:29:36 +00:00
Andrey Nering
58275b4b33 v3.33.1 2023-12-21 20:10:41 -03:00
Andrey Nering
862237a931 chore(readme): fix typo on link 2023-12-21 20:07:55 -03:00
Pete Davison
9d81608337 chore: changelog for #1437 2023-12-21 16:07:44 +00:00
Pete Davison
39a4b4d413 fix: variable propagation (#1437) 2023-12-21 16:04:45 +00:00
Pete Davison
21ceb05080 chore: changelog 2023-12-21 15:51:34 +00:00
Pete Davison
b592648d55 feat: support looping over map variables (#1436)
* feat: support looping over map variables

* feat: add .KEY variable
2023-12-21 15:43:56 +00:00
Pete Davison
658b6012a6 revert: docs back to .md files until prettier supports mdx 2023-12-21 15:20:14 +00:00
Pete Davison
311cdf00ab docs: add information about loops 2023-12-21 11:09:34 +00:00
Pete Davison
453538b405 chore: update any_variables doc to mdx 2023-12-21 02:26:53 +00:00
Andrey Nering
743a15f35b v3.33.0 2023-12-20 23:20:06 -03:00
Andrey Nering
f00ffad63d chore: changelog and docs for #1434 2023-12-20 23:17:44 -03:00
Andrey Nering
0d209ef05d docs: minor updates to the "any variables" experiment page 2023-12-20 23:11:50 -03:00
Pete Davison
e177f48e41 feat: CLI_FORCE special variable (#1434) 2023-12-21 02:08:57 +00:00
dependabot[bot]
e53dafa47e chore(deps): bump axios from 1.4.0 to 1.6.2 in /docs (#1433)
Bumps [axios](https://github.com/axios/axios) from 1.4.0 to 1.6.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.4.0...v1.6.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 23:07:22 -03:00
Pete Davison
7c93741670 feat: docusaurus v3 (#1432)
* feat: docusaurus v3

* feat: update release tool to stop it from converting links - this is now done use mdx plugins

* fix: broken links

* feat: more github links and prettier config

* chore: changelog

* fix: blog emoji
2023-12-21 01:59:29 +00:00
Pete Davison
43a2979e77 fix: non-evaluated nil values should be converted to empty strings to avoid empty interface errors in the templater 2023-12-20 19:55:25 -06:00
Pete Davison
cb195da72f chore: changelog 2023-12-20 19:55:25 -06:00
Pete Davison
77aaf996a1 feat: testdata 2023-12-20 19:55:25 -06:00
Pete Davison
7feceeae87 fix: handle errors when sh is used in Taskfiles with the any variables experiment enabled 2023-12-20 19:55:25 -06:00
Pete Davison
1eeb7d5cf9 fix: dynamic vars break with for because of fast-compiled tasks 2023-12-20 19:55:25 -06:00
Pete Davison
4a0414274f feat: for supports variables and lists of any type 2023-12-20 19:55:25 -06:00
Pete Davison
1a12b94bd3 feat: new dynamic variable syntax 2023-12-20 19:55:25 -06:00
Pete Davison
12a8fb0581 docs: any variables experiment 2023-12-20 19:55:25 -06:00
Pete Davison
20aad66e48 feat: update schema to support objects and arrays in vars 2023-12-20 19:55:25 -06:00
Pete Davison
1cd26ae1b9 feat: add ability to unmarshal as any when experiment enabled 2023-12-20 19:55:25 -06:00
Pete Davison
5516ac1a00 feat: change Var.Value from string to an any type 2023-12-20 19:55:25 -06:00
Pete Davison
de09e675c1 refactor: rename Var.Static to Var.Value 2023-12-20 19:55:25 -06:00
Pete Davison
f58257a208 feat: add any variable experiment flag 2023-12-20 19:55:25 -06:00
Pete Davison
abf0d29736 chore: changelog 2023-12-20 21:54:52 -03:00
Pete Davison
c5a2e92e5e feat: add aliases to --json output 2023-12-20 21:54:52 -03:00
Pete Davison
edb9dcd284 chore: bump golangci-lint version 2023-12-19 01:20:11 +00:00
William Sjökvist
cb0e6c5efc chore(docs): fix typo (#1422) 2023-12-13 13:35:02 -03:00
task-bot
4e35b1e9c2 chore: sync translations (#1418) 2023-12-13 13:34:35 -03:00
dependabot[bot]
1becb64d83 chore(deps): bump golang.org/x/term from 0.14.0 to 0.15.0 (#1419) 2023-12-13 13:34:20 -03:00
Andrey Nering
c4dce8f506 chore(docs): fix typo on "releasing" page 2023-11-29 23:17:32 -03:00
Andrey Nering
7c221ef999 v3.32.0 2023-11-29 22:40:04 -03:00
Pete Davison
ec35d43677 feat: support negative globs (#1324)
Co-authored-by: Andrey Nering <andrey@nering.com.br>
2023-11-29 22:38:12 -03:00
task-bot
a7958c0e3b chore: sync translations (#1404) 2023-11-22 09:52:01 -03:00
Pete Davison
546a4d7e46 feat: prefer remote taskfiles over cached ones (#1345)
* feat: prefer remote taskfiles over cached ones

* feat: implemented cache on network timeout

* feat: --download always downloads, but never executes tasks

* feat: --timeout flag

* fix: bug with timeout error handling

* chore: changelog
2023-11-17 14:51:10 -06:00
Andrey Nering
834babe0ef chore: add changelog + improve code for #1368 2023-11-15 22:38:53 -03:00
Alexander Mancevice
8355f16809 feat: add --no-status flag (#1368)
disables status check when running with `--list` `--json` options
2023-11-15 22:31:02 -03:00
dependabot[bot]
db2414402f chore(deps): bump golang.org/x/term from 0.13.0 to 0.14.0 (#1395) 2023-11-15 21:42:36 -03:00
dependabot[bot]
c7f80a3be4 chore(deps): bump golang.org/x/sync from 0.4.0 to 0.5.0 (#1396) 2023-11-15 21:39:43 -03:00
dependabot[bot]
b883a25c9a chore(deps): bump github.com/fatih/color from 1.15.0 to 1.16.0 (#1397) 2023-11-15 21:39:20 -03:00
task-bot
7fbded2b13 chore: sync translations (#1399) 2023-11-15 21:38:07 -03:00
task-bot
fb506acc27 chore: sync translations (#1389) 2023-11-07 11:15:18 -03:00
Andrey Nering
a8d3a69013 chore: update discord link on issue template
#1390
2023-11-07 11:13:35 -03:00
Iain Majer
30a2415ac8 Add silent to for_call schema (#1386)
* Add silent to for_call schema

* Update Changelog
2023-10-30 12:50:20 +00:00
Andrey Nering
b681ef9868 fix(platforms): do not run dynamic vars for other platforms (#1377) 2023-10-22 00:42:26 +00:00
task-bot
38efad5aa2 chore: sync translations (#1376) 2023-10-21 21:40:52 -03:00
Andrey Nering
6de3be1384 refactor(merge): use constant 2023-10-21 21:10:42 -03:00
Andrey Nering
781e55fce9 chore(website): remove gold sponsors section 2023-10-21 18:59:22 -03:00
task-bot
9b0de2e72e chore: sync translations (#1371) 2023-10-18 09:51:47 -03:00
dependabot[bot]
d4f7216256 chore(deps): bump @babel/traverse from 7.18.2 to 7.23.2 in /docs (#1374) 2023-10-18 09:51:17 -03:00
Andrey Nering
2842ae7fb5 chore(docs) add missing watch: true to example 2023-10-11 09:40:14 -03:00
task-bot
75aa066d9c chore: sync translations (#1367) 2023-10-07 22:10:49 -03:00
Andrey Nering
244aa93b3a chore(taskfile): add task to install goreleaser 2023-10-07 19:38:16 -03:00
Andrey Nering
6177376e50 v3.31.0 2023-10-07 19:10:57 -03:00
Andrey Nering
b5f6a237cc chore: add changelog entry for #1338 2023-10-07 19:03:25 -03:00
Marcello Sylvester Bauer
d741dfe26d fix(precondition): do not print error if context was aborted (#1338) 2023-10-07 19:01:57 -03:00
Andrey Nering
5168e54af7 chore: add changelog entry for #1343 2023-10-07 18:59:20 -03:00
Juan Ignacio Donoso
05755f3a52 fix: templates on task descriptions (#1343) 2023-10-07 18:57:14 -03:00
Pete Davison
dc77286282 feat: unify prompts (#1344) 2023-10-07 21:55:43 +00:00
Andrey Nering
222cd8c8f8 chore: add changelog entry for #1356 2023-10-07 18:41:35 -03:00
Oleg Butuzov
2f92f2ac5f fix: exclude other "ignored" files. (#1356) 2023-10-07 18:38:14 -03:00
Andrey Nering
a70f5aafc2 fix: increase max task calls limit from 100 to 1000
Closes #1321
Closes #1332
2023-10-07 18:29:16 -03:00
Andrey Nering
adfb96b637 feat: add ability to set watch: true in Taskfile (#1361) 2023-10-07 18:06:43 -03:00
dependabot[bot]
383746fcee chore(deps): bump golang.org/x/term from 0.12.0 to 0.13.0 (#1366) 2023-10-07 19:54:27 +00:00
dependabot[bot]
460ecdf8e9 chore(deps): bump golang.org/x/sync from 0.3.0 to 0.4.0 (#1365) 2023-10-07 16:48:45 -03:00
dependabot[bot]
74c503a33d chore(deps): bump postcss from 8.4.14 to 8.4.31 in /docs (#1364) 2023-10-07 16:48:25 -03:00
skaluzka
f0d25515e6 chore: remove accidentally added taskfile-dag.gv (#1357)
No real code changes here. It looks that an extra file has been
committed by mistake in b1ff13d3e8.

Signed-off-by: skaluzka <skaluzka@protonmail.com>
2023-10-01 16:32:04 +01:00
task-bot
9dc7502e4f chore: sync translations (#1336) 2023-09-20 09:53:38 -03:00
Pete Davison
078e213890 feat: error handling for undefined schema version (#1342)
* feat: error handling for undefined schema version

* docs: error codes

* chore: changelog
2023-09-19 19:21:40 +01:00
Pete Davison
b1ff13d3e8 docs: typo 2023-09-15 17:30:22 +00:00
Andrey Nering
f5aca75798 chore(docs): update branch name on some links 2023-09-14 21:45:25 -03:00
Andrey Nering
99d247e254 release: v3.30.1 2023-09-14 21:31:13 -03:00
Pete Davison
d1d312f396 refactor: minor improvements to setCurrentDir 2023-09-14 21:28:43 -03:00
Pete Davison
ba299aa71f fix: incorrect remote taskfiles cache directory 2023-09-14 21:28:43 -03:00
Pete Davison
92f30d4d70 chore: changelog 2023-09-14 21:28:43 -03:00
Pete Davison
93cccd4027 fix: only create a cache if the node is remote 2023-09-14 21:28:43 -03:00
Pete Davison
8e7e231aec fix: e.Dir not being set to the correct directory 2023-09-14 21:28:43 -03:00
Andrey Nering
72d77eb6c0 chore(deps): upgrade slim-sprig to v3.0.0 (#1329) 2023-09-14 01:59:35 +00:00
Andrey Nering
42ac242927 release: v3.30.0 2023-09-13 22:04:01 -03:00
Andrey Nering
d0551353f3 chore: add changelog entry for #1325 2023-09-13 21:43:40 -03:00
Reilly Brogan
1417f9f6cd feat(checksum): replace md5 with xxh3 to improve performance (#1325) 2023-09-13 21:26:48 -03:00
dependabot[bot]
978d66e148 chore(deps): bump golang.org/x/term from 0.11.0 to 0.12.0 (#1326) 2023-09-13 21:12:47 -03:00
task-bot
4fd69154a3 chore: sync translations (#1328) 2023-09-13 21:12:26 -03:00
Pete Davison
22ce67c5e5 feat: remote taskfiles (HTTP) (#1152)
* feat: remote taskfiles over http

* feat: allow insecure connections when --insecure flag is provided

* feat: better error handling for fetch errors

* fix: ensure cache directory always exists

* fix: setup logger before everything else

* feat: put remote taskfiles behind an experiment

* feat: --download and --offline flags for remote taskfiles

* feat: node.Read accepts a context

* feat: experiment docs

* chore: changelog

* chore: remove unused optional param from Node interface

* chore: tidy up and generalise NewNode function

* fix: use sha256 in remote checksum

* feat: --download by itself will not run a task

* feat: custom error if remote taskfiles experiment is not enabled

* refactor: BaseNode functional options and simplified FileNode

* fix: use hex encoding for checksum instead of b64
2023-09-12 22:42:54 +01:00
task-bot
84ad0056e4 chore: sync translations (#1323) 2023-09-04 09:46:45 -03:00
Pete Davison
07d5e80c57 fix: minor blog typos 2023-09-03 03:19:11 +00:00
Pete Davison
c6241af64a fix: il8n blog authors 2023-09-02 22:15:58 +00:00
Pete Davison
4f6eea8799 blog: introducing experiments 2023-09-02 21:52:43 +00:00
Pete Davison
a207289955 chore: update experiments and deprecation docs (#1315) 2023-09-02 17:48:05 -03:00
Andrey Nering
3f2abe011b chore: upgrade Go to v1.21.0 on lint and release actions 2023-09-02 17:43:45 -03:00
Pete Davison
afe8a618fe feat: node refactor (#1316)
* refactor: node reader interface

* refactor: rewrite Taskfile() as anon recursive func

* chore: NewNodeFromIncludedTaskfile

* chore: changelog
2023-09-02 21:24:01 +01:00
task-bot
b2e6c93b4b chore: sync translations (#1314) 2023-08-28 21:20:30 -03:00
Andrey Nering
c3d2437c3a chore(changelog): consolidate v3.29.0 and v3.29.1 2023-08-26 19:17:43 -03:00
Andrey Nering
e2552dae45 chore(website): update release docs to include instructions for winget 2023-08-26 19:17:24 -03:00
Andrey Nering
1189bdec87 goreleaser: skip automatic winget release on ci 2023-08-26 19:00:14 -03:00
Andrey Nering
f51f9621d1 fix: goreleaser deprecation on ci 2023-08-26 18:52:10 -03:00
Andrey Nering
19eba3cc14 v3.29.1 2023-08-26 18:45:44 -03:00
Andrey Nering
5b8b58b6d9 v3.29.0 2023-08-26 18:39:18 -03:00
Andrey Nering
d1f643ebd9 fix: --status flag should not have side-effects (#1313)
Closes #1305
Closes #1307

Co-authored-by: Giovanni Visciano <giovanni_visciano@yahoo.it>
2023-08-26 21:30:23 +00:00
Andrey Nering
e96712b020 fix: make sure USER_WORKING_DIR works corrently with includes (#1309)
Closes #1046
Closes #1205
Closes #1250
Closes #1293
Closes #1274
Closes #1309
Closes #1312

Co-authored-by: Marcus Spading <ms@fragmentum.net>
2023-08-26 21:06:50 +00:00
task-bot
6102900060 chore: sync translations (#1308) 2023-08-18 00:06:37 +00:00
Pete Davison
6f986af0d4 feat: bump minimum go version to 1.20 (#1302) 2023-08-11 22:46:37 +01:00
Andrey Nering
dd9b1a1065 chore: fix goreleaser deprecations 2023-08-09 22:50:07 -03:00
Andrey Nering
ae135f5203 chore: release automatically to winget using goreleaser 2023-08-09 22:44:29 -03:00
Calvin McLean
c42bc6914e fix: defer keyword in json schema
Closes #1288
2023-08-09 22:03:17 -03:00
Andrey Nering
0cddd8c167 chore(vscode): add sample settings.json with yaml schema configuration 2023-08-09 21:30:15 -03:00
Andrey Nering
22cd0edfc9 fix: signal and watch tests 2023-08-09 21:12:50 -03:00
Filip Solich
600966ac26 fix: add missing \n to watcher log
Closes #1285
Closes #1297
2023-08-09 21:09:11 -03:00
Andrey Nering
2b21fd2eda chore(website): reactivate carbon 2023-08-09 20:58:59 -03:00
task-bot
90a8c26b25 chore: sync translations (#1291) 2023-08-05 11:33:39 -03:00
dependabot[bot]
7145791f62 chore(deps): bump golang.org/x/term from 0.10.0 to 0.11.0 (#1298) 2023-08-05 11:33:18 -03:00
James Sansbury
d9a4b4241e docs: add required version for supporting loops (#1290) 2023-08-01 11:26:40 -03:00
task-bot
f219e1ee76 chore: sync translations (#1287) 2023-07-30 20:21:40 +00:00
skaluzka
c0d9c81393 docs: fix few typos in the api reference page (#1286) 2023-07-30 17:14:09 -03:00
task-bot
7bcdccc645 chore: sync translations (#1280) 2023-07-26 12:51:01 +00:00
Andrey Nering
44ca1fc77e release: v3.28.0 2023-07-24 22:12:09 -03:00
Andrey Nering
a16a5ea81a docs: small adjustment for #1220 2023-07-24 22:06:40 -03:00
Pete Davison
ca72f3c3a1 feat: added joinPath and relPath functions 2023-07-24 22:05:40 -03:00
Pete Davison
d447cc3f19 chore: make sources paths relative 2023-07-24 22:05:40 -03:00
Pete Davison
6be3ff6141 chore: sources instead of source 2023-07-24 22:05:40 -03:00
Pete Davison
36565bbbd2 fix: silent should be processed via taskCall 2023-07-24 22:05:40 -03:00
Pete Davison
755acd616c docs: for 2023-07-24 22:05:40 -03:00
Pete Davison
7ff1b1795e feat: for 2023-07-24 22:05:40 -03:00
Andrey Nering
7ece04e996 docs: add japanese and turkish translations (#1279) 2023-07-24 21:32:37 -03:00
Andrey Nering
d4d3571c96 changelog: add entry for #1263 2023-07-24 21:26:42 -03:00
Evan
364ddef56b fix: add nil guards in dependency merge (#1263) 2023-07-24 21:22:39 -03:00
Pete Davison
3908c05d14 chore: changelog 2023-07-24 21:13:37 -03:00
Pete Davison
6059ce2ac4 fix: exit codes for indirect tasks 2023-07-24 21:13:37 -03:00
task-bot
659ba317c1 chore: sync translations (#1267) 2023-07-24 20:53:17 -03:00
Andrey Nering
7e7a016df3 chore(docs): update formatting 2023-07-18 11:03:41 -03:00
task-bot
5041c8058d chore: sync translations (#1262) 2023-07-18 10:59:05 -03:00
dependabot[bot]
a66e804904 chore(deps): bump semver from 5.7.1 to 5.7.2 in /docs (#1258) 2023-07-11 11:17:44 -03:00
Andrey Nering
d6d571779d changelog: add entry for #1256 2023-07-08 11:44:57 -03:00
Hudson Clark
8a0689328b fix: propagate include vars in multi-level includes (#1256) 2023-07-08 11:42:38 -03:00
task-bot
2a0c99b5d8 chore: sync translations (#1253) 2023-07-08 11:08:59 -03:00
dependabot[bot]
6e3e95a721 chore(deps): bump golang.org/x/term from 0.9.0 to 0.10.0 (#1257) 2023-07-08 11:00:21 -03:00
Steve Russo
a4d242680b docs: fix two minor typos in usage.md (#1254) 2023-07-06 20:31:26 +00:00
task-bot
ee2e939d13 chore: sync translations (#1248) 2023-07-02 14:42:10 -03:00
Max Winterstein
788a63ca2f docs: add "tea" installation method (#1249) 2023-07-02 14:41:29 -03:00
Andrey Nering
dea98467c0 v3.27.1 2023-06-30 09:36:33 -03:00
Pete Davison
4e6ec14223 fix: ignore all errors when reading dotenv for experiments (#1245) 2023-06-30 09:33:37 -03:00
Andrey Nering
d6b7d532ed v3.27.0 2023-06-29 22:44:02 -03:00
Pete Davison
46f7bba90d feat: experiments flag (#1242) 2023-06-30 01:29:28 +00:00
Pete Davison
02f1c8482a fix: new line after prompts 2023-06-29 22:24:21 -03:00
Pete Davison
4de2ccea59 fix: remove duplicated quotes 2023-06-29 22:24:21 -03:00
Andrey Nering
0bf5fab9c0 chore(changelog): add entry for #1204 2023-06-29 22:20:10 -03:00
Andrey Nering
e97c48051e chore(changelog): fix typo 2023-06-29 22:15:09 -03:00
Ben Coleman
307f39cee3 feat: add ability to specify which vars are required (#1204) 2023-06-29 22:13:41 -03:00
task-bot
f346015d8c chore: sync translations (#1225) 2023-06-29 22:00:01 -03:00
Andrey Nering
a2f8adbb5c fix(interp): move from deprecated ExecHandler to the new ExecHandlers 2023-06-29 21:57:58 -03:00
dependabot[bot]
82510a04af chore(deps): bump mvdan.cc/sh/v3 from 3.6.0 to 3.7.0
Bumps [mvdan.cc/sh/v3](https://github.com/mvdan/sh) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/mvdan/sh/releases)
- [Changelog](https://github.com/mvdan/sh/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mvdan/sh/compare/v3.6.0...v3.7.0)

---
updated-dependencies:
- dependency-name: mvdan.cc/sh/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-29 21:57:58 -03:00
Andrey Nering
5eda349bbd chore(website): upcase "Crowdin" 2023-06-29 15:32:00 -03:00
Trim21
8d99c33472 chore(website): remove old chinese translation repo from community.md (#1243) 2023-06-29 18:26:26 +00:00
Pete Davison
5fdaa9aa36 feat: implement gentle force experiment draft (#1216)
* feat: implement gentle force experiment draft

* docs: changelog
2023-06-18 02:32:18 +01:00
Pete Davison
d8a12fe56d Support for experiment env vars (#1214)
* feat: experiments env var handling

* feat: read experiments from dotenv files

* docs: removed experimental cli flags

* feat: use vars instead of struct with reflection
2023-06-18 01:04:05 +00:00
task-bot
c79378f380 chore: sync translations (#1219) 2023-06-17 14:46:30 -03:00
Pete Davison
5e78171d3e feat: support lowercase Taskfiles (#1221) 2023-06-17 14:38:53 -03:00
Andrey Nering
d82b0faca1 chore(changelog): mention npm installation fixes 2023-06-17 11:54:04 -03:00
dependabot[bot]
26f3fb157f chore(deps): bump golang.org/x/term from 0.8.0 to 0.9.0 (#1223) 2023-06-17 11:45:59 -03:00
dependabot[bot]
7c66bcc857 chore(deps): bump @go-task/go-npm from 0.1.18 to 0.2.0 (#1224) 2023-06-17 11:45:03 -03:00
dependabot[bot]
1dd5d7ad1a chore(deps): bump golang.org/x/sync from 0.2.0 to 0.3.0 (#1222) 2023-06-17 11:43:08 -03:00
Andrey Nering
667835f2a0 ci: disable github pages
We recently migrated to Netlify.
2023-06-14 20:31:57 -03:00
task-bot
427e0cd46d chore: sync translations (#1217) 2023-06-14 09:07:57 -03:00
Antoine Prouvost
92aa4927db chore(website): add conda community installation method (#1218) 2023-06-14 09:07:03 -03:00
Andrey Nering
5c68f87114 chore(website): update website colors (#1201) 2023-06-11 10:53:25 -03:00
Andrey Nering
ede8da7677 chore(website): add netlify badge 2023-06-10 22:49:09 -03:00
Andrey Nering
b44231a6b8 chore(changelog): fix typo 2023-06-10 22:33:17 -03:00
Andrey Nering
ae3884386d v3.26.0 2023-06-10 22:26:49 -03:00
Andrey Nering
6cc8d602fc chore(changelog): add entry for #1131 2023-06-10 22:12:22 -03:00
Tim De Pauw
e2c1b3b931 feat: add support for single cmd task syntax (#1131) 2023-06-10 22:08:28 -03:00
task-bot
59e99caf8a chore: sync translations (#1215) 2023-06-10 21:30:10 -03:00
task-bot
127b685104 chore: sync translations (#1206) 2023-06-10 21:18:54 -03:00
Pete Davison
5af361ab1c docs: add possible values for --sort 2023-06-10 21:12:02 -03:00
Pete Davison
06727c3892 chore: generalise the usage message 2023-06-10 21:12:02 -03:00
Andrey Nering
a452f0b4bd fix(docs): avoid <> as it breaks crowdin 2023-06-10 21:06:20 -03:00
dependabot[bot]
9ee714d048 chore(deps): bump golang.org/x/term from 0.3.0 to 0.8.0 (#1212) 2023-06-10 20:56:35 -03:00
Andrey Nering
76eb49c355 chore: update email address 2023-06-08 10:59:31 -03:00
Pete Davison
91878fccaf fix: api reference formatting 2023-06-06 19:44:08 +00:00
Andrey Nering
44aaec86a1 chore: improvements on #1163 + changelog entry 2023-06-03 22:33:22 -03:00
Max Cheetham
f815ce2901 feat(prompts): add ability for tasks to prompt user pre execution (#1163) 2023-06-03 22:33:00 -03:00
Pete Davison
105756eb27 docs: add comments from #1115 to faq and styleguide (#1202) 2023-06-03 21:30:45 -03:00
Pete Davison
7a2f8d691c feat: add a deprecation warning when running Taskfiles with a v2 schema (#1199) 2023-06-03 21:05:48 -03:00
Pete Davison
75659485ee feat: update issue templates 2023-06-03 20:54:36 -03:00
Pete Davison
18cb66f8c7 feat: add workflows for experiment labels 2023-06-03 20:54:36 -03:00
Pete Davison
45c3592818 feat: add experiments workflow 2023-06-03 20:54:36 -03:00
Pete Davison
2789801668 chore: move experiments into subfolder 2023-06-03 20:54:36 -03:00
Pete Davison
e09f42791a chore: update and re-order taskfile versions doc 2023-06-03 20:54:36 -03:00
Pete Davison
8d19ad306e chore: changelog 2023-06-03 20:54:36 -03:00
Pete Davison
793c1e5587 docs: add experiments doc and v2 deprecation notice 2023-06-03 20:54:36 -03:00
Andrey Nering
1a86c2c52d chore(readme): add entry for #1194 2023-06-03 19:23:57 -03:00
Andrey Nering
15cbe131fb fix(website): syntax highlight on json code block 2023-06-03 19:21:36 -03:00
Andrew Berry
082cdcc358 fix: only rewrite checksum files if the checksum has changed 2023-06-03 19:20:08 -03:00
Misite Bao
1936142042 feat(website): add spanish to language dropdown menu (#1187) 2023-06-03 15:45:51 -03:00
dependabot[bot]
8e4afa88f7 chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#1196) 2023-06-03 15:44:46 -03:00
Pete Davison
794de91d05 chore: update dependabot workflow label 2023-05-30 21:50:12 +00:00
Pete Davison
16bd9bc61e chore: update translations workflow label 2023-05-30 21:35:02 +00:00
Pete Davison
c0d3584626 chore: update label names in workflows (#1195) 2023-05-30 22:24:01 +01:00
task-bot
e0d3e33c32 chore: sync translations (#1188) 2023-05-28 17:51:17 -03:00
dependabot[bot]
e37c109f0c chore(deps): bump @go-task/go-npm from 0.1.17 to 0.1.18 (#1192) 2023-05-28 17:33:50 -03:00
Andrey Nering
efd8bab615 chore(deps): add dependabot configuration for npm package 2023-05-28 17:28:56 -03:00
task-bot
603463926e chore: sync translations (#1186) 2023-05-26 09:59:43 -03:00
Lucas Fernando Cardoso Nunes
31bbb47162 docs: correct typo (#1184) 2023-05-25 13:11:28 -03:00
task-bot
62b52911fa chore: sync translations (#1182) 2023-05-24 09:37:39 -03:00
Misite Bao
ac96612a17 style(website): improve language lable (#1183) 2023-05-24 09:31:46 -03:00
Misite Bao
3913701f7f chore: add environment variables to the deployment environment (#1181) 2023-05-23 20:48:53 -03:00
Andrey Nering
dcf66e7380 v3.25.0 2023-05-22 22:45:00 -03:00
Andrey Nering
188034650b chore(changelog): add some entries 2023-05-22 22:18:41 -03:00
Mads H. Danquah
e01b5565a2 docs: describe how to use the silent flag for dependencies (#680) 2023-05-22 22:09:29 -03:00
Mads H. Danquah
8bc98fedbf feat: make it possible to silence dependencies (#680) 2023-05-22 22:09:29 -03:00
Mads H. Danquah
9a406f5998 fix: ensure that calls to other tasks can be silenced (#680) 2023-05-22 22:09:29 -03:00
Trim21
f0e9751f7e chore: improve powershell completion script (#1168) 2023-05-22 21:47:11 -03:00
Trim21
0aa6c5eae8 chore(website): remove old chinese translation from the sidebar
Closes #1169
2023-05-22 21:38:58 -03:00
Misite Bao
785fc4ac3c feat(website): add translation progress
Closes #1173
Closes #1170
Closes #1102
2023-05-22 21:28:51 -03:00
task-bot
3eab444c03 chore: sync translations (#1180) 2023-05-22 21:00:19 -03:00
task-bot
b28aff04a7 chore: sync translations (#1156) 2023-05-22 20:51:56 -03:00
dependabot[bot]
81fd454ef4 chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#1175) 2023-05-22 20:49:34 -03:00
task-bot
65c923e07a chore: sync translations (#1155) 2023-05-07 22:43:56 -03:00
task-bot
45dd77ad6d chore: sync translations (#1154) 2023-05-06 21:24:46 -03:00
Misite Bao
51c2a104b2 docs: fix broken links and paths (#1143) 2023-05-06 21:16:11 -03:00
Andrey Nering
59ffb0a4c4 chore: add changelog entry for #1144 2023-05-06 21:13:19 -03:00
Andrey Nering
38341fffbd fix: print errors in red color
Using the logger package so envs like NO_COLOR and FORCE_COLOR keeps working.
2023-05-06 21:11:16 -03:00
Pete Davison
6633e65ee6 refactor: move TaskRunError handling into main function 2023-05-06 21:11:16 -03:00
Pete Davison
745de72d7e refactor: move flags into a package-level struct var 2023-05-06 21:11:16 -03:00
dependabot[bot]
af95e5b3e0 chore(deps): bump golang.org/x/sync from 0.1.0 to 0.2.0 (#1153) 2023-05-06 19:26:48 -03:00
Pete Davison
270ca697b2 fix: tabwriter in usage output (#1151) 2023-05-06 19:04:20 -03:00
Pete Davison
02ac79e577 chore: update contribution guide to support Task for Visual Studio Code 2023-05-06 19:03:02 -03:00
Pete Davison
031558afe4 chore: update github contribution file 2023-05-06 19:03:02 -03:00
Andrey Nering
eaf252f46d chore: update "sync translations" action 2023-05-06 18:59:11 -03:00
task-bot
bf043f411b chore(website): sync translations (#1145) 2023-05-06 18:55:50 -03:00
Pete Davison
7ec5cac56b fix: nil pointer when version is omitted (#1149) 2023-05-02 16:51:39 +01:00
task-bot
50d6e057d5 website: sync translations (#1140) 2023-04-26 21:31:30 -03:00
Andrey Nering
8adb9f4ece changelog: add entry for #1134 2023-04-26 21:29:15 -03:00
Clint Mod
c145658206 fix some errors being unintendedly supressed (#1134) 2023-04-26 21:28:54 -03:00
Pete Davison
8cfac5a25a refactor: remove newlines from formatter print functions (#1137) 2023-04-26 21:20:06 -03:00
Andrey Nering
1e8fc5011b website: fix sidebar order after inclusion of a new page on #1138 2023-04-26 21:14:00 -03:00
Andrey Nering
42dfc778f8 website: add rel="me" to Mastodon links
This is used for verification:
https://joinmastodon.org/verification
2023-04-26 21:13:51 -03:00
Pete Davison
90b11dd02e feat: improve docs for vscode-task (#1138) 2023-04-26 20:57:58 -03:00
task-bot
44b5b1b6ed Website: Sync translations (#1123) 2023-04-26 20:55:03 -03:00
Andrey Nering
c2523796c0 Add CHANGELOG entry for #1068 2023-04-15 18:24:15 -03:00
Andrey Nering
125f34ef47 chore: add freebsd to the list of operating systems to build
Ref #1068
2023-04-15 18:17:57 -03:00
Andrey Nering
5a361f7845 v3.24.0 2023-04-15 18:01:29 -03:00
Andrey Nering
52e0b59548 docs: another master -> main replace 2023-04-15 17:58:34 -03:00
Pete Davison
b42299a5aa feat: use mockery/testify for mocking instead of mockgen/gomock (#1118) 2023-04-15 17:27:14 -03:00
Pete Davison
f9c77acd96 feat: custom error codes (#1114) 2023-04-15 17:22:25 -03:00
Andrey Nering
9ec544817f Add CHANGELOG entry for #1113 2023-04-15 16:52:46 -03:00
Patrick Jackson
606a8f9db5 fish: fix completions for tasks with aliases (#1113) 2023-04-15 16:51:44 -03:00
Andrey Nering
6995cd71d9 Add CHANGELOG entry for #1049 2023-04-15 16:44:20 -03:00
Pete Davison
d9165646c6 chore: update refs from master to main (#1048) 2023-04-15 16:39:35 -03:00
task-bot
720137304b Website: Sync translations (#1111) 2023-04-15 16:18:51 -03:00
Misite Bao
8026d8ddb3 Configure Prettier for Markdown formatting (#1112) 2023-04-15 16:13:29 -03:00
dependabot[bot]
7876ccb3bc Bump github.com/Masterminds/semver/v3 from 3.2.0 to 3.2.1 (#1121) 2023-04-15 16:07:37 -03:00
Pete Davison
f22389a824 feat: implement task sorting with --sort flag (#1105)
* refactor: move deepcopy into its own package

* feat: add generic orderedmap implementation

* refactor: implement tasks with orderedmap

* feat: implement sort flag for all task outputs

* refactor: implement vars with orderedmap

* chore: docs

* fix: linting issues

* fix: non deterministic behavior in tests
2023-04-06 12:07:57 +01:00
Pete Davison
719f30219b refactor: use require for testing errors (#1100) 2023-04-06 11:18:41 +01:00
Andrey Nering
cfa409b5e7 Add CHANGELOG entry for #1107 2023-04-05 22:21:38 -03:00
Mads Høgstedt Danquah
1b30c9dbca Make status checks respect task and global silent mode (#1107) 2023-04-05 22:18:58 -03:00
Pete Davison
09c9094a6b feat: enforce gofumpt linter 2023-04-05 21:55:42 -03:00
Pete Davison
aab51c331f refactor: enable gofmt linter and fix all issues
- also rewrite 'interface{}' as 'any'
2023-04-05 21:55:42 -03:00
Misite Bao
a6d57496c2 Website: Fix typo on usage.md (#1104) 2023-04-05 21:52:27 -03:00
Misite Bao
f285d5dbf7 Fix upload-source-documents.yml (#1101) 2023-04-05 21:51:25 -03:00
task-bot
79fde26f4f Website: Sync translations (#1103) 2023-04-05 21:48:43 -03:00
task-bot
a729ee6fca Website: Sync translations (#1093) 2023-03-30 22:25:31 -03:00
Andrey Nering
451a3773c3 GitHub Action: Automatic upload not working. Switch to manual trigger 2023-03-30 22:09:14 -03:00
Andrey Nering
38ade8fbc9 Documentation: Update link 2023-03-30 22:05:20 -03:00
Andrey Nering
c229570bd9 GitHub Action: Fix upload documents workflow
The previous used action verified if any changes happened *during execution*
(via a `git diff` call).

Changing to the one that is properly able to check changes in the last commit.
2023-03-30 22:00:47 -03:00
Andrey Nering
ce14f10297 Small adjustments for #1090
Wrap text in 80 chars.
2023-03-30 21:53:06 -03:00
Misite Bao
5430c49833 docs: add winget installation instructions (#1090) 2023-03-30 21:51:03 -03:00
Andrey Nering
510b977cea GitHub Action: Use token to avoid rate limit issues 2023-03-30 21:33:17 -03:00
Andrey Nering
7a966d8c1b Add CHANGELOG entry for #1098 2023-03-30 21:26:53 -03:00
André Klitzing
bdf7fb0858 Ignore .hg for Mercurial, too (#1098) 2023-03-30 21:25:08 -03:00
Misite Bao
a80da8b65c docs: optimize document style (#1091) 2023-03-30 21:15:42 -03:00
Pete Davison
22983bcdd3 feat: release tool improvements (#1096) 2023-03-30 21:10:11 -03:00
task-bot
4d4acc72f0 Website: Sync translations (#1089) 2023-03-26 22:43:22 -03:00
Misite Bao
d7d8d3411c chore: add scheduled task for sync documents 2023-03-26 22:35:01 -03:00
Misite Bao
006097bee2 chore: add auto upload source documents workflow 2023-03-26 22:35:01 -03:00
Andrey Nering
4b23d63d39 v3.23.0 2023-03-26 21:42:46 -03:00
Pete Davison
d8053f64ef Prepare for upcoming extension release (#1088) 2023-03-26 21:14:19 -03:00
Pete Davison
4cbdcb2659 chore: changelog 2023-03-26 20:58:20 -03:00
Pete Davison
5583cea936 feat: create release command 2023-03-26 20:58:20 -03:00
Pete Davison
cc1fd3d03e fix: deep copying pointers inside slices (#1072) 2023-03-25 16:13:06 -03:00
Misite Bao
d72eb009e4 docs: optimize document structure (#1074) 2023-03-25 16:09:31 -03:00
Pete Davison
738ffde962 fix: checksum variable in status is incorrect (#1080)
* fix: checksum variable in status is incorrect

* chore: changelog
2023-03-23 16:09:16 -05:00
Pete Davison
34f15a4976 fix: broken link to scoop bucket (#1073) 2023-03-21 10:42:51 -03:00
github-actions[bot]
c807c7bd39 Website: Sync translations (#1071) 2023-03-20 22:50:37 -03:00
Andrey Nering
1081231b7c Adjustments to GitHub Actions 2023-03-20 22:45:23 -03:00
Andrey Nering
fc50b846c4 CHANGELOG entry + Small adjustments to #1058 2023-03-20 22:33:24 -03:00
Misite Bao
eead5f44fc docs: add Simplified Chinese translation 2023-03-20 22:25:34 -03:00
Misite Bao
fc0280a6ab feat(website): add Crowdin CLI tool and workflow 2023-03-20 22:25:34 -03:00
Misite Bao
65f5222a2a feat(website): add Simplified Chinese menu 2023-03-20 22:25:34 -03:00
Misite Bao
54b5d4d389 feat(website): write English translations 2023-03-20 22:25:34 -03:00
dependabot[bot]
ee36c8ba9c build(deps): bump github.com/fatih/color from 1.14.1 to 1.15.0 (#1070) 2023-03-20 21:52:13 -03:00
Pete Davison
e40d2eec9e feat: add task location data to json output (#1056)
* feat: add task location data to json output

* feat: add root taskfile location to --json output
2023-03-17 12:34:06 +00:00
Misite Bao
15ef1fa1c2 Make --init generate .yml instead of .yaml (#1062) 2023-03-16 21:53:01 -03:00
Andrey Nering
291ee123c9 CHANGELOG: Mention contributor 2023-03-16 21:42:11 -03:00
Andrey Nering
1b7009f4d5 CHANGELOG: Add references to entry 2023-03-16 21:40:23 -03:00
Dhanu Saputra
9c3ee234f1 Add splitArgs template function (#1059) 2023-03-16 21:38:24 -03:00
dependabot[bot]
e0fcb040ee build(deps): bump @sideway/formula from 3.0.0 to 3.0.1 in /docs (#1064)
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 14:46:23 -03:00
dependabot[bot]
fc2b0e0fee build(deps): bump webpack from 5.72.1 to 5.76.1 in /docs (#1060)
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.1 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.1...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 14:40:35 -03:00
Sorin Sbarnea
44bc0971ad Website > Community: Document mk tool support (#1052) 2023-03-12 16:01:19 -03:00
Pete Davison
8717c4c287 Merge pull request #1047 from go-task/contribution-guide
chore: minor fixes to contribution guide
2023-03-10 19:28:26 +00:00
Pete Davison
cf542f6fdf chore: minor fixes to contribution guide 2023-03-10 18:51:14 +00:00
Andrey Nering
94e4a2431b Merge branch 'master' of https://github.com/go-task/task 2023-03-10 15:37:40 -03:00
Andrey Nering
3eb4c9eae8 v3.22.0 2023-03-10 15:35:56 -03:00
dependabot[bot]
5ecabc5fe2 build(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (#1036)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-10 15:31:39 -03:00
Pete Davison
0838d48ee3 refactor: decouple fingerprinting from executor (#1039) 2023-03-10 15:27:30 -03:00
Pete Davison
c64f8818be Merge pull request #1043 from go-task/update-install-from-source-docs
chore: remove installation docs for Go 1.15
2023-03-09 19:16:57 +00:00
Pete Davison
97ffd84d0e chore: remove installation docs for Go 1.15 2023-03-09 19:07:05 +00:00
Andrey Nering
f2114f09f7 Fix capitalization of flags descriptions on task -h
Also, adds missing periods.
2023-03-08 23:24:39 -03:00
Andrey Nering
9c844850e4 Add --global (-g) flag (#1029)
This will run a Taskfile from the home directory, i.e., `$HOME/Taskfile.yml`.
2023-03-08 23:21:23 -03:00
Andrey Nering
68aef2ef0d Add CHANGELOG entry for #1022 2023-03-08 22:37:04 -03:00
Dennis Jekubczyk
88d644a7e9 Add ability to set error_only: true on the group output mode 2023-03-08 22:34:52 -03:00
dependabot[bot]
4b97d4f7f5 build(deps): bump dns-packet from 5.3.1 to 5.4.0 in /docs (#1034)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v5.3.1...5.4.0)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-08 22:23:31 -03:00
Andrey Nering
bc14c633ae Taskfile: Remove task commited by mistake 2023-03-08 22:21:27 -03:00
Pete Davison
a29e5d39ca Merge pull request #1037 from go-task/fix-status-and-sources
fix: status and sources
2023-03-07 00:35:45 +00:00
Pete Davison
f1506ee500 fix: status and sources 2023-03-07 00:30:24 +00:00
Andrey Nering
6e346de9fb CHANGELOG: Add entry for #1035 2023-03-06 09:47:33 -03:00
Harel Wahnich
99ab2a4d62 for task up to date check both status and sources (#1035)
* remove redundant if statement

* add subtests to TestStatusChecksum
2023-03-05 22:16:41 -08:00
Pete Davison
d4ed7c3cfc Merge pull request #1004 from go-task/semver
feat: use semver package for taskfile schema version
2023-03-02 19:07:52 +00:00
pzloty
bc0554575a Fix output "prefixed" option in schema.json (#1031)
Fix the output option to match implementation and documentation.
2023-03-02 10:42:11 -03:00
Andrey Nering
1f4906244b Add CHANGELOG for #1025 2023-03-01 22:06:16 -03:00
Bevan Arps
52756ab83e Fix deadlock issue with run: once (#1025) 2023-03-01 21:53:38 -03:00
Pete Davison
97dcbe6932 Merge pull request #1026 from go-task/fix-schema-for-group
fix: schema for output group
2023-02-28 13:49:03 +00:00
Pete Davison
e35bf22dd3 fix: schema for output group (#1005) 2023-02-28 11:50:26 +01:00
Andrey Nering
a36b1b9cec Website: Remove Carbon 2023-02-23 19:30:10 -03:00
Andrey Nering
1920ee38c3 v3.21.0 2023-02-22 22:12:48 -03:00
João Pedro
ec2110e58f Add new TASK_VERSION special variable
Closes #1014
Closes #990
2023-02-22 22:08:38 -03:00
Andrey Nering
12a1cd6f62 Docs: Update API page 2023-02-16 21:16:43 -03:00
Aleksandr Komlev
9af056e746 Add FORCE_COLOR env support (#1003) 2023-02-16 21:12:44 -03:00
Pete Davison
c8fe450623 Merge pull request #1010 from go-task/go-1-20
chore: update to go 1.20
2023-02-13 13:33:51 +00:00
Pete Davison
ab1fe742f3 chore: update to go 1.20 2023-02-13 13:28:49 +00:00
Pete Davison
8b72c86ba5 feat: use semver package for taskfile schema version 2023-02-10 18:14:38 +00:00
Pete Davison
28c5f4a635 Merge pull request #1007 from go-task/fix-tasks-being-incorrectly-marked-as-internal
fix: tasks being incorrectly marked as internal
2023-02-10 18:14:01 +00:00
Pete Davison
74f69a21cd fix: tasks being incorrectly marked as internal 2023-02-10 17:02:11 +00:00
dependabot[bot]
e23dacd6d4 build(deps): bump github.com/joho/godotenv from 1.4.0 to 1.5.1 (#1002)
Bumps [github.com/joho/godotenv](https://github.com/joho/godotenv) from 1.4.0 to 1.5.1.
- [Release notes](https://github.com/joho/godotenv/releases)
- [Commits](https://github.com/joho/godotenv/compare/v1.4.0...v1.5.1)

---
updated-dependencies:
- dependency-name: github.com/joho/godotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 09:41:37 -03:00
Andrey Nering
58d582941b Documentation: Remove mentions of Minify in favor of esbuild 2023-02-04 20:29:10 -03:00
dependabot[bot]
3bbc51949c build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs (#1000)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-04 18:51:05 -03:00
Andrey Nering
69e0254a99 Website: Update 2023-01-29 15:42:59 -03:00
Andrey Nering
1091a914bd Documentation: version: '2' -> version: '3'
https://github.com/go-task/task/pull/929#discussion_r1082370557
2023-01-29 15:39:45 -03:00
dependabot[bot]
ecc65a218e build(deps): bump github.com/fatih/color from 1.13.0 to 1.14.1 (#995)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.13.0 to 1.14.1.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.13.0...v1.14.1)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-28 08:07:12 -03:00
dependabot[bot]
426ed7eff6 build(deps): bump ua-parser-js from 0.7.31 to 0.7.33 in /docs (#991)
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-27 09:55:18 -03:00
Andrey Nering
73aba36309 v3.20.0 2023-01-14 17:34:15 -03:00
Andrey Nering
cb393ccd3a Add CHANGELOG entry + small adjustments to #977 2023-01-14 17:18:26 -03:00
Amin Yahyaabadi
347fcf9f67 fix: avoid reruns when the timestamp method is used (#977) 2023-01-14 17:17:36 -03:00
Andrey Nering
fce7575b03 Add README entry for #982 2023-01-14 16:48:04 -03:00
Pete Davison
2da7ddc399 chore: optimize task filtering (#982) 2023-01-14 16:45:52 -03:00
Pete Davison
1c1be683ab feat: set and shopt directives (#929)
Co-authored-by: Andrey Nering <andrey@nering.com.br>
2023-01-14 16:41:56 -03:00
Andrey Nering
4be1050234 Optimize the Taskfile a bit
`go list ./...` takes quite a few seconds to run. Let's restrict it to the
tasks that actually use it.
2023-01-06 21:41:18 -03:00
Andrey Nering
2efb3533ec Add CHANGELOG + improvements to #980
Closes #978
2023-01-06 21:39:57 -03:00
Lea Anthony
aa6c7e4b94 Add support for 'platforms' in both task and command (#980) 2023-01-06 21:38:35 -03:00
Andrey Nering
63c50d13ee Website/README: Add link to the Mastodon account 2023-01-01 21:24:16 -03:00
Andrey Nering
c1e127e42f Website: Update outdated URL 2022-12-31 14:28:37 -03:00
dependabot[bot]
9e38e8a4db build(deps): bump json5 from 2.2.1 to 2.2.2 in /docs (#972)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-31 14:15:20 -03:00
Andrey Nering
b4c95d6b0b v3.19.1 2022-12-31 14:03:55 -03:00
Pete Davison
c4766e2611 fix: add missing nil check (#971)
Co-authored-by: Andrey Nering <andrey@nering.com.br>
2022-12-31 13:54:26 -03:00
Pete Davison
796097e3ab fix: watch interval (#970) 2022-12-31 13:48:49 -03:00
Pete Davison
c7d9efebf9 Merge pull request #967 from go-task/gha-issue-closed
feat: add action for when an issue is closed
2022-12-23 16:34:40 -06:00
Pete Davison
8f4306d321 feat: add action for when an issue is closed 2022-12-23 22:31:02 +00:00
Pete Davison
435f086cb7 Merge pull request #965 from go-task/fix-interval-schema
fix: incorrect schema type for interval
2022-12-22 18:36:15 -06:00
Pete Davison
01c9158120 fix: incorrect schema type for interval
- Fixes #962
2022-12-23 00:34:08 +00:00
Andrey Nering
e235d77d64 Add CHANGELOG to #964 2022-12-22 21:27:19 -03:00
Henrique Corrêa
dbe8131b75 Close Taskfile after reading it (#964)
This should fix issues preventing modifications to the Taskfile while tasks are still running, like switching git branches for example.

See #963.
2022-12-22 21:23:17 -03:00
Pete Davison
0a9d76515e Merge pull request #957 from go-task/faq
FAQ doc
2022-12-19 19:58:06 +00:00
Pete Davison
0ce1af9ee0 WIP: FAQ doc 2022-12-19 19:51:22 +00:00
Andrey Nering
c4452d2698 Website > Installation: Document official Homebrew go-task package 2022-12-18 22:41:42 -03:00
Pete Davison
491888f6c0 feat: improve unmarshal error handling and use v3 yaml interface everywhere (#959) 2022-12-18 22:11:31 -03:00
Pete Davison
e4158dc5e4 feat: add local-prefixes flag to goimports linter (#958) 2022-12-18 22:06:09 -03:00
Andrey Nering
0307ca8ac6 Website: Upgrade Docusaurus (#956) 2022-12-17 11:43:43 -03:00
Andrey Nering
156a273351 go.mod: Pin released v3.6.0 version of mvdan/sh 2022-12-17 11:18:23 -03:00
Andrey Nering
d6d51a2f8b Prevent TestFileWatcherInterval from running on CI
This test can fail intermittently. It's fine to run it only locally.

We were already doing this for TestSignalSentToProcessGroup.
2022-12-17 11:08:41 -03:00
Andrey Nering
a98b41d657 Add goimports as a linter 2022-12-17 11:02:17 -03:00
Andrey Nering
87ec78fbaa Cleanup: Remove duplicated internal/sleepit/main.go file 2022-12-17 11:01:54 -03:00
Andrey Nering
957bff4b89 CHANGELOG + small improvements to #936 2022-12-17 10:35:30 -03:00
David Alpert
321f7b59d8 Add --json flag to be used by editor extensions (#936) 2022-12-17 10:31:00 -03:00
Andrey Nering
41a9316523 Website: Update "Donate" page + FUNDING.yml 2022-12-07 21:33:49 -03:00
445 changed files with 53015 additions and 9578 deletions

View File

@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at andrey.nering@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at andrey@nering.com.br. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

View File

@@ -1,6 +1,14 @@
* Bug reports and feature requests are welcome in [the issues][issues]
* Pull Requests are welcome. For more complex changes and features it's
recommended to open an issue with the feature request first
* Documentation contributions are as important as code contributions
## You can find our [contribution guide on our website][contributing]
- Please read it carefully before opening a PR.
- If you have any questions, you can:
- [Open an issue][issues]
- [Create a discussion][discussions]
- [Chat to us on Discord][discord]
<!-- prettier-ignore-start -->
[contributing]: https://taskfile.dev/contributing
[issues]: https://github.com/go-task/task/issues
[discussions]: https://github.com/go-task/task/discussions
[discord]: https://discord.gg/6TY36E39UK
<!-- prettier-ignore-end -->

4
.github/FUNDING.yml vendored
View File

@@ -1,3 +1,3 @@
github: andreynering
github: [andreynering, pd93]
open_collective: task
custom: 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url'
custom: https://taskfile.dev/donate/

View File

@@ -3,13 +3,18 @@ name: Bug Report
about: Use this to report bugs and issues
---
> Thanks for your bug report!
>
> Before submitting this issue, please make sure the same problem was
> not already reported by someone else.
>
> Please describe the bug you're facing. Consider pasting example
> Taskfiles showing how to reproduce the problem.
<!--
Thanks for your bug report!
Before submitting this issue, please make sure the same problem was not
already reported by someone else.
Please describe the bug you're facing. Consider pasting example Taskfiles
showing how to reproduce the problem.
-->
- Task version:
- Operating System:
- Operating system:
- Experiments enabled:

View File

@@ -1,7 +1,10 @@
blank_issues_enabled: false
contact_links:
- name: Extension for Visual Studio Code
url: https://github.com/go-task/vscode-task
about: Issues related to the Visual Studio Code extension should be opened here.
- name: Help forum on Discord
url: https://discord.com/channels/974121106208354339/1025054680289660989
url: https://discord.gg/6TY36E39UK
about: 'The Discord #help channel is the best way to get help from the community.'
- name: Questions, Ideas and General Discussions
url: https://github.com/go-task/task/discussions

View File

@@ -3,9 +3,13 @@ name: Feature Request
about: Use this to make feature requests
---
> Describe in detail what feature do you want to see in Task.
> Give examples if possible.
>
> Please, search if this wasn't proposed before, and if this is more like an idea
> than a strong feature request, consider opening a
> [discussion](https://github.com/go-task/task/discussions) instead.
<!--
Describe in detail what feature do you want to see in Task.
Give examples if possible.
Please, search if this wasn't proposed before, and if this is more like an idea
than a strong feature request, consider opening a
[discussion](https://github.com/go-task/task/discussions) instead.
-->

View File

@@ -8,3 +8,17 @@ updates:
day: saturday
time: '08:00'
timezone: America/Sao_Paulo
labels:
- "area: dependencies"
- "lang: go"
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: saturday
time: '08:00'
timezone: America/Sao_Paulo
labels:
- "area: dependencies"
- "lang: javascript"

View File

@@ -10,6 +10,7 @@ jobs:
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
@@ -30,13 +31,13 @@ jobs:
repo: context.repo.repo,
}
)
if (labels.find(label => label.name === 'awaiting response')) {
if (labels.find(label => label.name === 'state: awaiting response')) {
if (comments[comments.length-1].user?.login === issue.data.user?.login) {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'awaiting response'
name: 'state: awaiting response'
})
}
}

29
.github/workflows/issue-closed.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: issue closed
on:
issues:
types: [closed]
jobs:
issue-closed:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
const labels = await github.paginate(
github.rest.issues.listLabelsOnIssue, {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
}
)
if (labels.find(label => label.name === 'state: needs triage')) {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'state: needs triage'
})
}

123
.github/workflows/issue-experiment.yml vendored Normal file
View File

@@ -0,0 +1,123 @@
name: issue experiment
on:
issues:
types: [labeled]
jobs:
issue-experiment-proposed:
if: github.event.label.name == format('experiment{0} proposed', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This issue has been marked as an experiment proposal! :test_tube: It will now enter a period of consultation during which we encourage the community to provide feedback on the proposed design. Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
issue-experiment-draft:
if: github.event.label.name == format('experiment{0} draft', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been marked as a draft! :sparkles: This means that an initial implementation has been added to the latest release of Task! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
issue-experiment-candidate:
if: github.event.label.name == format('experiment{0} candidate', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been marked as a candidate! :fire: This means that the implementation is nearing completion and we are entering a period for final comments and feedback! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
issue-experiment-stable:
if: github.event.label.name == format('experiment{0} stable', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been marked as stable! :metal: This means that the implementation is now final and ready to be released. No more changes will be made and the experiment is safe to use in production! You can find information about this experiment and how to enable it in our [experiments documentation](https://taskfile.dev/experiments). Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
issue-experiment-released:
if: github.event.label.name == format('experiment{0} released', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been released! :rocket: This means that it is no longer an experiment and is available in the latest major version of Task. Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})
issue-experiment-abandoned:
if: github.event.label.name == format('experiment{0} abandoned', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been abandoned. :disappointed: This means that this feature will not be added to Task and any experimental functionality will be removed. Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})
issue-experiment-superseded:
if: github.event.label.name == format('experiment{0} superseded', ':')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This experiment has been superseded. :seedling: This means that another experiment has replaced this one. Please see the [experiment workflow documentation](https://taskfile.dev/experiments#workflow) for more information on how we release experiments.'
})
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})

View File

@@ -5,11 +5,12 @@ on:
types: [opened]
jobs:
needs-triage:
issue-needs-triage:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GH_PAT}}
script: |
const labels = await github.paginate(
github.rest.issues.listLabelsOnIssue, {
@@ -23,6 +24,6 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['needs triage']
labels: ['state: needs triage']
})
}

View File

@@ -6,7 +6,7 @@ on:
tags:
- v*
branches:
- master
- main
jobs:
lint:
@@ -14,11 +14,26 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.21.x
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.1
version: v1.55.2
lint-jsonschema:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: actions/checkout@v3
- name: install check-jsonschema
run: python -m pip install 'check-jsonschema==0.27.3'
- name: check-jsonschema (metaschema)
run: check-jsonschema --check-metaschema docs/static/schema.json

View File

@@ -15,12 +15,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.21.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}

View File

@@ -0,0 +1,36 @@
name: Sync Translations
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
sync-translated-documents:
runs-on: ubuntu-latest
if: github.repository == 'go-task/task'
steps:
- uses: actions/checkout@v3
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync Translations
run: task crowdin:pull
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
working-directory: ./docs
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore: sync translations"
title: "chore: sync translations"
branch: chore/sync-translations
delete-branch: true
author: task-bot <106601941+task-bot@users.noreply.github.com>
labels: "area: translation"
token: ${{ secrets.GH_PAT }}

View File

@@ -6,14 +6,14 @@ on:
tags:
- v*
branches:
- master
- main
jobs:
test:
name: Test
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.20.x, 1.21.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.platform}}
steps:

View File

@@ -0,0 +1,38 @@
name: Upload Source Documents
on:
push:
branches:
- main
workflow_dispatch:
jobs:
push_files_to_crowdin:
name: Push files to Crowdin
if: github.repository == 'go-task/task'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Verify changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
docs/docs
docs/blog
docs/i18n/en
docs/src/pages
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload source documents
if: steps.changed-files.outputs.any_changed == 'true'
run: task crowdin:push
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
working-directory: ./docs

View File

@@ -1,35 +0,0 @@
name: Website Deploy
on:
push:
branches:
- master
jobs:
website-deploy:
name: Website Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./docs
- name: Build website
run: yarn build
working-directory: ./docs
- name: Website Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
user_name: task-bot
user_email: 106601941+task-bot@users.noreply.github.com

View File

@@ -1,27 +0,0 @@
name: Website Test
on:
pull_request:
branches:
- master
jobs:
website-test:
name: Website Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./docs
- name: Test build website
run: yarn build
working-directory: ./docs

3
.gitignore vendored
View File

@@ -21,7 +21,8 @@ dist/
# editors
.idea/
.vscode/
.vscode/*
!.vscode/*-sample.json
.fleet/
# exuberant ctags

18
.golangci.yml Normal file
View File

@@ -0,0 +1,18 @@
# NOTE(@andreynering): The linters listed here are additions on top of
# those enabled by default:
#
# https://golangci-lint.run/usage/linters/#enabled-by-default
linters:
enable:
- goimports
- gofmt
- gofumpt
linters-settings:
goimports:
local-prefixes: github.com/go-task/task
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'

View File

@@ -1,27 +1,28 @@
build:
binary: task
main: ./cmd/task
goos:
- windows
- darwin
- linux
goarch:
- 386
- amd64
- arm
- arm64
goarm:
- 6
ignore:
- goos: darwin
goarch: 386
env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- -s -w # Don't set main.version.
builds:
- binary: task
main: ./cmd/task
goos:
- windows
- darwin
- linux
- freebsd
goarch:
- '386'
- amd64
- arm
- arm64
goarm:
- '6'
ignore:
- goos: darwin
goarch: '386'
env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- -s -w # Don't set main.version.
gomod:
proxy: true
@@ -71,7 +72,7 @@ brews:
license: MIT
homepage: https://taskfile.dev
folder: Formula
tap:
repository:
owner: go-task
name: homebrew-tap
test:
@@ -84,3 +85,41 @@ brews:
commit_author:
name: task-bot
email: 106601941+task-bot@users.noreply.github.com
winget:
- name: Task
publisher: Task
short_description: A task runner / simpler Make alternative written in Go
description: Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.
license: MIT
homepage: https://taskfile.dev/
publisher_url: https://taskfile.dev/
publisher_support_url: https://github.com/go-task/task/issues
package_identifier: Task.Task
commit_author:
name: task-bot
email: 106601941+task-bot@users.noreply.github.com
commit_msg_template: "chore: bump {{.PackageIdentifier}} to {{.Tag}}"
release_notes_url: https://github.com/go-task/task/releases/tag/{{.Tag}}
tags:
- build
- build-tool
- devops
- go
- make
- makefile
- runner
- task
- task-runner
- taskfile
- tool
skip_upload: true
repository:
owner: microsoft
name: winget-pkgs
pull_request:
enabled: true
base:
owner: go-task
name: winget-pkgs
branch: "bump-task-to-{{.Tag}}"

4
.mockery.yaml Normal file
View File

@@ -0,0 +1,4 @@
with-expecter: true
keeptree: true
case: underscore
output: ./internal/mocks

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
18.12.1

7
.prettierrc.yml Normal file
View File

@@ -0,0 +1,7 @@
trailingComma: none
singleQuote: true
overrides:
- files: "*.md"
options:
printWidth: 80
proseWrap: always

5
.vscode/settings-sample.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"./docs/static/schema.json": "Taskfile.yml"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,18 +10,6 @@
</p>
<p>
<a href="https://taskfile.dev/installation/">Installation</a> | <a href="https://taskfile.dev/usage/">Documentation</a> | <a href="https://twitter.com/taskfiledev">Twitter</a> | <a href="https://discord.gg/6TY36E39UK">Discord</a>
<a href="https://taskfile.dev/installation/">Installation</a> | <a href="https://taskfile.dev/usage/">Documentation</a> | <a href="https://twitter.com/taskfiledev">Twitter</a> | <a href="https://fosstodon.org/@task">Mastodon</a> | <a href="https://discord.gg/6TY36E39UK">Discord</a>
</p>
</div>
## Gold Sponsors
<div align="center">
| [Appwrite][appwrite] |
| - |
| [![Appwrite](/docs/static/img/appwrite.svg)][appwrite] |
</div>
[appwrite]: https://appwrite.io/?utm_source=task_github&utm_medium=social&utm_campaign=task_oss_fund

View File

@@ -7,11 +7,7 @@ includes:
dir: ./docs
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
GO_PACKAGES:
sh: go list ./...
BIN: "{{.ROOT_DIR}}/bin"
env:
CGO_ENABLED: '0'
@@ -28,7 +24,30 @@ tasks:
sources:
- './**/*.go'
cmds:
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
- go install -v ./cmd/task
generate:
desc: Runs Go generate to create mocks
aliases: [gen, g]
deps: [install:mockery]
sources:
- "internal/fingerprint/checker.go"
generates:
- "internal/mocks/*.go"
cmds:
- "{{.BIN}}/mockery --dir ./internal/fingerprint --name SourcesCheckable"
- "{{.BIN}}/mockery --dir ./internal/fingerprint --name StatusCheckable"
install:mockery:
desc: Installs mockgen; a tool to generate mock files
vars:
MOCKERY_VERSION: v2.24.0
env:
GOBIN: "{{.BIN}}"
status:
- go version -m {{.BIN}}/mockery | grep github.com/vektra/mockery | grep {{.MOCKERY_VERSION}}
cmds:
- go install github.com/vektra/mockery/v2@{{.MOCKERY_VERSION}}
mod:
desc: Downloads and tidy Go modules
@@ -47,23 +66,32 @@ tasks:
aliases: [l]
sources:
- './**/*.go'
- .golangci.yml
cmds:
- golangci-lint run
lint:fix:
desc: Runs golangci-lint and fixes any issues
sources:
- './**/*.go'
- .golangci.yml
cmds:
- golangci-lint run --fix
sleepit:build:
desc: Builds the sleepit test helper
sources:
- ./cmd/sleepit/**/*.go
generates:
- ./bin/sleepit
- "{{.BIN}}/sleepit"
cmds:
- go build -o ./bin/sleepit{{exeExt}} ./cmd/sleepit
- go build -o {{.BIN}}/sleepit{{exeExt}} ./cmd/sleepit
sleepit:run:
desc: Builds the sleepit test helper
deps: [sleepit:build]
cmds:
- ./bin/sleepit {{.CLI_ARGS}}
- "{{.BIN}}/sleepit {{.CLI_ARGS}}"
silent: true
test:
@@ -72,30 +100,33 @@ tasks:
deps: [install]
cmds:
- go test {{catLines .GO_PACKAGES}}
vars:
GO_PACKAGES:
sh: go list ./...
test:signals:
desc: Runs test suite with signals tests included
test:all:
desc: Runs test suite with signals and watch tests included
deps: [install, sleepit:build]
cmds:
- go test {{catLines .GO_PACKAGES}} -tags signals
- go test {{catLines .GO_PACKAGES}} -tags 'signals watch'
vars:
GO_PACKAGES:
sh: go list ./...
test-release:
goreleaser:test:
desc: Tests release process without publishing
cmds:
- goreleaser --snapshot --rm-dist
- goreleaser --snapshot --clean
docs:changelog:
desc: Copy CHANGELOG.md to the documentation website
vars:
FILE: docs/docs/changelog.md
goreleaser:install:
desc: Installs goreleaser
cmds:
- rm {{.FILE}}
- 'echo "---" >> {{.FILE}}'
- 'echo "slug: /changelog/" >> {{.FILE}}'
- 'echo "sidebar_position: 6" >> {{.FILE}}'
- 'echo "---" >> {{.FILE}}'
- 'echo "" >> {{.FILE}}'
- 'cat CHANGELOG.md >> {{.FILE}}'
- go install github.com/goreleaser/goreleaser@latest
release:
desc: Prepare the project for a new release
cmds:
- go run ./cmd/release {{.CLI_ARGS}}
npm:publish:
desc: Publish release to npm
@@ -105,4 +136,7 @@ tasks:
packages:
cmds:
- echo '{{.GO_PACKAGES}}'
vars:
GO_PACKAGES:
sh: go list ./...
silent: true

View File

@@ -3,56 +3,22 @@ package args
import (
"strings"
"github.com/go-task/task/v3/taskfile"
"github.com/go-task/task/v3/taskfile/ast"
)
// ParseV3 parses command line argument: tasks and global variables
func ParseV3(args ...string) ([]taskfile.Call, *taskfile.Vars) {
var calls []taskfile.Call
var globals = &taskfile.Vars{}
// Parse parses command line argument: tasks and global variables
func Parse(args ...string) ([]ast.Call, *ast.Vars) {
calls := []ast.Call{}
globals := &ast.Vars{}
for _, arg := range args {
if !strings.Contains(arg, "=") {
calls = append(calls, taskfile.Call{Task: arg})
calls = append(calls, ast.Call{Task: arg})
continue
}
name, value := splitVar(arg)
globals.Set(name, taskfile.Var{Static: value})
}
if len(calls) == 0 {
calls = append(calls, taskfile.Call{Task: "default"})
}
return calls, globals
}
// ParseV2 parses command line argument: tasks and vars of each task
func ParseV2(args ...string) ([]taskfile.Call, *taskfile.Vars) {
var calls []taskfile.Call
var globals = &taskfile.Vars{}
for _, arg := range args {
if !strings.Contains(arg, "=") {
calls = append(calls, taskfile.Call{Task: arg})
continue
}
if len(calls) < 1 {
name, value := splitVar(arg)
globals.Set(name, taskfile.Var{Static: value})
} else {
if calls[len(calls)-1].Vars == nil {
calls[len(calls)-1].Vars = &taskfile.Vars{}
}
name, value := splitVar(arg)
calls[len(calls)-1].Vars.Set(name, taskfile.Var{Static: value})
}
}
if len(calls) == 0 {
calls = append(calls, taskfile.Call{Task: "default"})
globals.Set(name, ast.Var{Value: value})
}
return calls, globals

View File

@@ -7,18 +7,19 @@ import (
"github.com/stretchr/testify/assert"
"github.com/go-task/task/v3/args"
"github.com/go-task/task/v3/taskfile"
"github.com/go-task/task/v3/internal/omap"
"github.com/go-task/task/v3/taskfile/ast"
)
func TestArgsV3(t *testing.T) {
func TestArgs(t *testing.T) {
tests := []struct {
Args []string
ExpectedCalls []taskfile.Call
ExpectedGlobals *taskfile.Vars
ExpectedCalls []ast.Call
ExpectedGlobals *ast.Vars
}{
{
Args: []string{"task-a", "task-b", "task-c"},
ExpectedCalls: []taskfile.Call{
ExpectedCalls: []ast.Call{
{Task: "task-a"},
{Task: "task-b"},
{Task: "task-c"},
@@ -26,184 +27,82 @@ func TestArgsV3(t *testing.T) {
},
{
Args: []string{"task-a", "FOO=bar", "task-b", "task-c", "BAR=baz", "BAZ=foo"},
ExpectedCalls: []taskfile.Call{
ExpectedCalls: []ast.Call{
{Task: "task-a"},
{Task: "task-b"},
{Task: "task-c"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"FOO", "BAR", "BAZ"},
Mapping: map[string]taskfile.Var{
"FOO": taskfile.Var{Static: "bar"},
"BAR": taskfile.Var{Static: "baz"},
"BAZ": taskfile.Var{Static: "foo"},
},
ExpectedGlobals: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"FOO": {Value: "bar"},
"BAR": {Value: "baz"},
"BAZ": {Value: "foo"},
},
[]string{"FOO", "BAR", "BAZ"},
),
},
},
{
Args: []string{"task-a", "CONTENT=with some spaces"},
ExpectedCalls: []taskfile.Call{
ExpectedCalls: []ast.Call{
{Task: "task-a"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"CONTENT"},
Mapping: map[string]taskfile.Var{
"CONTENT": taskfile.Var{Static: "with some spaces"},
},
ExpectedGlobals: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"CONTENT": {Value: "with some spaces"},
},
[]string{"CONTENT"},
),
},
},
{
Args: []string{"FOO=bar", "task-a", "task-b"},
ExpectedCalls: []taskfile.Call{
ExpectedCalls: []ast.Call{
{Task: "task-a"},
{Task: "task-b"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"FOO"},
Mapping: map[string]taskfile.Var{
"FOO": {Static: "bar"},
},
ExpectedGlobals: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"FOO": {Value: "bar"},
},
[]string{"FOO"},
),
},
},
{
Args: nil,
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
Args: nil,
ExpectedCalls: []ast.Call{},
},
{
Args: []string{},
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
Args: []string{},
ExpectedCalls: []ast.Call{},
},
{
Args: []string{"FOO=bar", "BAR=baz"},
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"FOO", "BAR"},
Mapping: map[string]taskfile.Var{
"FOO": {Static: "bar"},
"BAR": {Static: "baz"},
},
Args: []string{"FOO=bar", "BAR=baz"},
ExpectedCalls: []ast.Call{},
ExpectedGlobals: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"FOO": {Value: "bar"},
"BAR": {Value: "baz"},
},
[]string{"FOO", "BAR"},
),
},
},
}
for i, test := range tests {
t.Run(fmt.Sprintf("TestArgs%d", i+1), func(t *testing.T) {
calls, globals := args.ParseV3(test.Args...)
calls, globals := args.Parse(test.Args...)
assert.Equal(t, test.ExpectedCalls, calls)
if test.ExpectedGlobals.Len() > 0 || globals.Len() > 0 {
assert.Equal(t, test.ExpectedGlobals, globals)
assert.Equal(t, test.ExpectedGlobals.Keys(), globals.Keys())
assert.Equal(t, test.ExpectedGlobals.Values(), globals.Values())
}
})
}
}
func TestArgsV2(t *testing.T) {
tests := []struct {
Args []string
ExpectedCalls []taskfile.Call
ExpectedGlobals *taskfile.Vars
}{
{
Args: []string{"task-a", "task-b", "task-c"},
ExpectedCalls: []taskfile.Call{
{Task: "task-a"},
{Task: "task-b"},
{Task: "task-c"},
},
},
{
Args: []string{"task-a", "FOO=bar", "task-b", "task-c", "BAR=baz", "BAZ=foo"},
ExpectedCalls: []taskfile.Call{
{
Task: "task-a",
Vars: &taskfile.Vars{
Keys: []string{"FOO"},
Mapping: map[string]taskfile.Var{
"FOO": taskfile.Var{Static: "bar"},
},
},
},
{Task: "task-b"},
{
Task: "task-c",
Vars: &taskfile.Vars{
Keys: []string{"BAR", "BAZ"},
Mapping: map[string]taskfile.Var{
"BAR": taskfile.Var{Static: "baz"},
"BAZ": taskfile.Var{Static: "foo"},
},
},
},
},
},
{
Args: []string{"task-a", "CONTENT=with some spaces"},
ExpectedCalls: []taskfile.Call{
{
Task: "task-a",
Vars: &taskfile.Vars{
Keys: []string{"CONTENT"},
Mapping: map[string]taskfile.Var{
"CONTENT": taskfile.Var{Static: "with some spaces"},
},
},
},
},
},
{
Args: []string{"FOO=bar", "task-a", "task-b"},
ExpectedCalls: []taskfile.Call{
{Task: "task-a"},
{Task: "task-b"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"FOO"},
Mapping: map[string]taskfile.Var{
"FOO": {Static: "bar"},
},
},
},
{
Args: nil,
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
},
{
Args: []string{},
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
},
{
Args: []string{"FOO=bar", "BAR=baz"},
ExpectedCalls: []taskfile.Call{
{Task: "default"},
},
ExpectedGlobals: &taskfile.Vars{
Keys: []string{"FOO", "BAR"},
Mapping: map[string]taskfile.Var{
"FOO": {Static: "bar"},
"BAR": {Static: "baz"},
},
},
},
}
for i, test := range tests {
t.Run(fmt.Sprintf("TestArgs%d", i+1), func(t *testing.T) {
calls, globals := args.ParseV2(test.Args...)
assert.Equal(t, test.ExpectedCalls, calls)
if test.ExpectedGlobals.Len() > 0 || globals.Len() > 0 {
assert.Equal(t, test.ExpectedGlobals, globals)
}
})
}
}

137
cmd/release/main.go Normal file
View File

@@ -0,0 +1,137 @@
package main
import (
"errors"
"fmt"
"os"
"os/exec"
"regexp"
"strings"
"time"
"github.com/Masterminds/semver/v3"
)
const (
changelogSource = "CHANGELOG.md"
changelogTarget = "docs/docs/changelog.md"
)
var (
changelogReleaseRegex = regexp.MustCompile(`## Unreleased`)
versionRegex = regexp.MustCompile(`(?m)^ "version": "\d+\.\d+\.\d+",$`)
)
func main() {
if err := release(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func release() error {
if len(os.Args) != 2 {
return errors.New("error: expected version number")
}
version, err := getVersion()
if err != nil {
return err
}
if err := bumpVersion(version, os.Args[1]); err != nil {
return err
}
fmt.Println(version)
if err := changelog(version); err != nil {
return err
}
if err := setJSONVersion("package.json", version); err != nil {
return err
}
if err := setJSONVersion("package-lock.json", version); err != nil {
return err
}
return nil
}
func getVersion() (*semver.Version, error) {
cmd := exec.Command("git", "describe", "--tags", "--abbrev=0")
b, err := cmd.Output()
if err != nil {
return nil, err
}
return semver.NewVersion(strings.TrimSpace(string(b)))
}
func bumpVersion(version *semver.Version, verb string) error {
switch verb {
case "major":
*version = version.IncMajor()
case "minor":
*version = version.IncMinor()
case "patch":
*version = version.IncPatch()
default:
*version = *semver.MustParse(verb)
}
return nil
}
func changelog(version *semver.Version) error {
// Open changelog target file
b, err := os.ReadFile(changelogTarget)
if err != nil {
return err
}
// Get the current frontmatter
currentChangelog := string(b)
sections := strings.SplitN(currentChangelog, "---", 3)
if len(sections) != 3 {
return errors.New("error: invalid frontmatter")
}
frontmatter := strings.TrimSpace(sections[1])
// Open changelog source file
b, err = os.ReadFile(changelogSource)
if err != nil {
return err
}
changelog := string(b)
date := time.Now().Format("2006-01-02")
// Replace "Unreleased" with the new version and date
changelog = changelogReleaseRegex.ReplaceAllString(changelog, fmt.Sprintf("## v%s - %s", version, date))
// Write the changelog to the source file
if err := os.WriteFile(changelogSource, []byte(changelog), 0o644); err != nil {
return err
}
// Add the frontmatter to the changelog
changelog = fmt.Sprintf("---\n%s\n---\n\n%s", frontmatter, changelog)
// Write the changelog to the target file
return os.WriteFile(changelogTarget, []byte(changelog), 0o644)
}
func setJSONVersion(fileName string, version *semver.Version) error {
// Read the JSON file
b, err := os.ReadFile(fileName)
if err != nil {
return err
}
// Replace the version
new := versionRegex.ReplaceAllString(string(b), fmt.Sprintf(` "version": "%s",`, version.String()))
// Write the JSON file
return os.WriteFile(fileName, []byte(new), 0o644)
}

View File

@@ -19,10 +19,8 @@ Commands
handle Handle signals: on reception of SIGINT perform cleanup before exiting
version Show the sleepit version`
var (
// Filled by the linker.
fullVersion = "unknown" // example: v0.0.9-8-g941583d027-dirty
)
// Filled by the linker.
var fullVersion = "unknown" // example: v0.0.9-8-g941583d027-dirty
func main() {
os.Exit(run(os.Args[1:]))
@@ -130,11 +128,11 @@ func supervisor(
// The goroutine will prepend its prints with the prefix `name`.
// The goroutine will simulate some work and will terminate when one of the following
// conditions happens:
// 1. When `howlong` is elapsed. This case will be signaled on the `workerDone` channel.
// 2. When something happens on channel `canceled`. Note that this simulates real-life,
// so cancellation is not instantaneous: if the caller wants a synchronous cancel,
// it should send a message; if instead it wants an asynchronous cancel, it should
// close the channel.
// 1. When `howlong` is elapsed. This case will be signaled on the `workerDone` channel.
// 2. When something happens on channel `canceled`. Note that this simulates real-life,
// so cancellation is not instantaneous: if the caller wants a synchronous cancel,
// it should send a message; if instead it wants an asynchronous cancel, it should
// close the channel.
func worker(
canceled <-chan struct{},
howlong time.Duration,

View File

@@ -6,23 +6,23 @@ import (
"log"
"os"
"path/filepath"
"runtime/debug"
"strings"
"time"
"github.com/spf13/pflag"
"mvdan.cc/sh/v3/syntax"
"github.com/go-task/task/v3"
"github.com/go-task/task/v3/args"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/experiments"
"github.com/go-task/task/v3/internal/logger"
"github.com/go-task/task/v3/taskfile"
"github.com/go-task/task/v3/internal/sort"
ver "github.com/go-task/task/v3/internal/version"
"github.com/go-task/task/v3/taskfile/ast"
)
var (
version = ""
)
const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]
const usage = `Usage: task [flags...] [task...]
Runs the specified task(s). Falls back to the "default" task if no task name
was specified, or lists all tasks if an unknown task name was specified.
@@ -44,7 +44,63 @@ tasks:
Options:
`
var flags struct {
version bool
help bool
init bool
list bool
listAll bool
listJson bool
taskSort string
status bool
noStatus bool
insecure bool
force bool
forceAll bool
watch bool
verbose bool
silent bool
assumeYes bool
dry bool
summary bool
exitCode bool
parallel bool
concurrency int
dir string
entrypoint string
output ast.Output
color bool
interval time.Duration
global bool
experiments bool
download bool
offline bool
timeout time.Duration
}
func main() {
if err := run(); err != nil {
l := &logger.Logger{
Stdout: os.Stdout,
Stderr: os.Stderr,
Verbose: flags.verbose,
Color: flags.color,
}
if err, ok := err.(*errors.TaskRunError); ok && flags.exitCode {
l.Errf(logger.Red, "%v\n", err)
os.Exit(err.TaskExitCode())
}
if err, ok := err.(errors.TaskError); ok {
l.Errf(logger.Red, "%v\n", err)
os.Exit(err.Code())
}
l.Errf(logger.Red, "%v\n", err)
os.Exit(errors.CodeUnknown)
}
os.Exit(errors.CodeOk)
}
func run() error {
log.SetFlags(0)
log.SetOutput(os.Stderr)
@@ -53,64 +109,74 @@ func main() {
pflag.PrintDefaults()
}
var (
versionFlag bool
helpFlag bool
init bool
list bool
listAll bool
status bool
force bool
watch bool
verbose bool
silent bool
dry bool
summary bool
exitCode bool
parallel bool
concurrency int
dir string
entrypoint string
output taskfile.Output
color bool
interval string
)
pflag.BoolVar(&flags.version, "version", false, "Show Task version.")
pflag.BoolVarP(&flags.help, "help", "h", false, "Shows Task usage.")
pflag.BoolVarP(&flags.init, "init", "i", false, "Creates a new Taskfile.yml in the current folder.")
pflag.BoolVarP(&flags.list, "list", "l", false, "Lists tasks with description of current Taskfile.")
pflag.BoolVarP(&flags.listAll, "list-all", "a", false, "Lists tasks with or without a description.")
pflag.BoolVarP(&flags.listJson, "json", "j", false, "Formats task list as JSON.")
pflag.StringVar(&flags.taskSort, "sort", "", "Changes the order of the tasks when listed. [default|alphanumeric|none].")
pflag.BoolVar(&flags.status, "status", false, "Exits with non-zero exit code if any of the given tasks is not up-to-date.")
pflag.BoolVar(&flags.noStatus, "no-status", false, "Ignore status when listing tasks as JSON")
pflag.BoolVar(&flags.insecure, "insecure", false, "Forces Task to download Taskfiles over insecure connections.")
pflag.BoolVarP(&flags.watch, "watch", "w", false, "Enables watch of the given task.")
pflag.BoolVarP(&flags.verbose, "verbose", "v", false, "Enables verbose mode.")
pflag.BoolVarP(&flags.silent, "silent", "s", false, "Disables echoing.")
pflag.BoolVarP(&flags.assumeYes, "yes", "y", false, "Assume \"yes\" as answer to all prompts.")
pflag.BoolVarP(&flags.parallel, "parallel", "p", false, "Executes tasks provided on command line in parallel.")
pflag.BoolVarP(&flags.dry, "dry", "n", false, "Compiles and prints tasks in the order that they would be run, without executing them.")
pflag.BoolVar(&flags.summary, "summary", false, "Show summary about a task.")
pflag.BoolVarP(&flags.exitCode, "exit-code", "x", false, "Pass-through the exit code of the task command.")
pflag.StringVarP(&flags.dir, "dir", "d", "", "Sets directory of execution.")
pflag.StringVarP(&flags.entrypoint, "taskfile", "t", "", `Choose which Taskfile to run. Defaults to "Taskfile.yml".`)
pflag.StringVarP(&flags.output.Name, "output", "o", "", "Sets output style: [interleaved|group|prefixed].")
pflag.StringVar(&flags.output.Group.Begin, "output-group-begin", "", "Message template to print before a task's grouped output.")
pflag.StringVar(&flags.output.Group.End, "output-group-end", "", "Message template to print after a task's grouped output.")
pflag.BoolVar(&flags.output.Group.ErrorOnly, "output-group-error-only", false, "Swallow output from successful tasks.")
pflag.BoolVarP(&flags.color, "color", "c", true, "Colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable.")
pflag.IntVarP(&flags.concurrency, "concurrency", "C", 0, "Limit number tasks to run concurrently.")
pflag.DurationVarP(&flags.interval, "interval", "I", 0, "Interval to watch for changes.")
pflag.BoolVarP(&flags.global, "global", "g", false, "Runs global Taskfile, from $HOME/{T,t}askfile.{yml,yaml}.")
pflag.BoolVar(&flags.experiments, "experiments", false, "Lists all the available experiments and whether or not they are enabled.")
// Gentle force experiment will override the force flag and add a new force-all flag
if experiments.GentleForce.Enabled {
pflag.BoolVarP(&flags.force, "force", "f", false, "Forces execution of the directly called task.")
pflag.BoolVar(&flags.forceAll, "force-all", false, "Forces execution of the called task and all its dependant tasks.")
} else {
pflag.BoolVarP(&flags.forceAll, "force", "f", false, "Forces execution even when the task is up-to-date.")
}
// Remote Taskfiles experiment will adds the "download" and "offline" flags
if experiments.RemoteTaskfiles.Enabled {
pflag.BoolVar(&flags.download, "download", false, "Downloads a cached version of a remote Taskfile.")
pflag.BoolVar(&flags.offline, "offline", false, "Forces Task to only use local or cached Taskfiles.")
pflag.DurationVar(&flags.timeout, "timeout", time.Second*10, "Timeout for downloading remote Taskfiles.")
}
pflag.BoolVar(&versionFlag, "version", false, "show Task version")
pflag.BoolVarP(&helpFlag, "help", "h", false, "shows Task usage")
pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yaml in the current folder")
pflag.BoolVarP(&list, "list", "l", false, "lists tasks with description of current Taskfile")
pflag.BoolVarP(&listAll, "list-all", "a", false, "lists tasks with or without a description")
pflag.BoolVar(&status, "status", false, "exits with non-zero exit code if any of the given tasks is not up-to-date")
pflag.BoolVarP(&force, "force", "f", false, "forces execution even when the task is up-to-date")
pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task")
pflag.BoolVarP(&verbose, "verbose", "v", false, "enables verbose mode")
pflag.BoolVarP(&silent, "silent", "s", false, "disables echoing")
pflag.BoolVarP(&parallel, "parallel", "p", false, "executes tasks provided on command line in parallel")
pflag.BoolVarP(&dry, "dry", "n", false, "compiles and prints tasks in the order that they would be run, without executing them")
pflag.BoolVar(&summary, "summary", false, "show summary about a task")
pflag.BoolVarP(&exitCode, "exit-code", "x", false, "pass-through the exit code of the task command")
pflag.StringVarP(&dir, "dir", "d", "", "sets directory of execution")
pflag.StringVarP(&entrypoint, "taskfile", "t", "", `choose which Taskfile to run. Defaults to "Taskfile.yml"`)
pflag.StringVarP(&output.Name, "output", "o", "", "sets output style: [interleaved|group|prefixed]")
pflag.StringVar(&output.Group.Begin, "output-group-begin", "", "message template to print before a task's grouped output")
pflag.StringVar(&output.Group.End, "output-group-end", "", "message template to print after a task's grouped output")
pflag.BoolVarP(&color, "color", "c", true, "colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable")
pflag.IntVarP(&concurrency, "concurrency", "C", 0, "limit number tasks to run concurrently")
pflag.StringVarP(&interval, "interval", "I", "5s", "interval to watch for changes")
pflag.Parse()
if versionFlag {
fmt.Printf("Task version: %s\n", getVersion())
return
if flags.version {
fmt.Printf("Task version: %s\n", ver.GetVersion())
return nil
}
if helpFlag {
if flags.help {
pflag.Usage()
return
return nil
}
if init {
if flags.experiments {
l := &logger.Logger{
Stdout: os.Stdout,
Stderr: os.Stderr,
Verbose: flags.verbose,
Color: flags.color,
}
return experiments.List(l)
}
if flags.init {
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
@@ -118,120 +184,144 @@ func main() {
if err := task.InitTaskfile(os.Stdout, wd); err != nil {
log.Fatal(err)
}
return
return nil
}
if dir != "" && entrypoint != "" {
log.Fatal("task: You can't set both --dir and --taskfile")
return
}
if entrypoint != "" {
dir = filepath.Dir(entrypoint)
entrypoint = filepath.Base(entrypoint)
if flags.download && flags.offline {
return errors.New("task: You can't set both --download and --offline flags")
}
if output.Name != "group" {
if output.Group.Begin != "" {
log.Fatal("task: You can't set --output-group-begin without --output=group")
return
if flags.global && flags.dir != "" {
log.Fatal("task: You can't set both --global and --dir")
return nil
}
if flags.global {
home, err := os.UserHomeDir()
if err != nil {
return fmt.Errorf("task: Failed to get user home directory: %w", err)
}
if output.Group.End != "" {
log.Fatal("task: You can't set --output-group-end without --output=group")
return
flags.dir = home
}
if flags.dir != "" && flags.entrypoint != "" {
return errors.New("task: You can't set both --dir and --taskfile")
}
if flags.entrypoint != "" {
flags.dir = filepath.Dir(flags.entrypoint)
flags.entrypoint = filepath.Base(flags.entrypoint)
}
if flags.output.Name != "group" {
if flags.output.Group.Begin != "" {
return errors.New("task: You can't set --output-group-begin without --output=group")
}
if flags.output.Group.End != "" {
return errors.New("task: You can't set --output-group-end without --output=group")
}
if flags.output.Group.ErrorOnly {
return errors.New("task: You can't set --output-group-error-only without --output=group")
}
}
var taskSorter sort.TaskSorter
switch flags.taskSort {
case "none":
taskSorter = &sort.Noop{}
case "alphanumeric":
taskSorter = &sort.AlphaNumeric{}
}
e := task.Executor{
Force: force,
Watch: watch,
Verbose: verbose,
Silent: silent,
Dir: dir,
Dry: dry,
Entrypoint: entrypoint,
Summary: summary,
Parallel: parallel,
Color: color,
Concurrency: concurrency,
Interval: interval,
Force: flags.force,
ForceAll: flags.forceAll,
Insecure: flags.insecure,
Download: flags.download,
Offline: flags.offline,
Timeout: flags.timeout,
Watch: flags.watch,
Verbose: flags.verbose,
Silent: flags.silent,
AssumeYes: flags.assumeYes,
Dir: flags.dir,
Dry: flags.dry || flags.status,
Entrypoint: flags.entrypoint,
Summary: flags.summary,
Parallel: flags.parallel,
Color: flags.color,
Concurrency: flags.concurrency,
Interval: flags.interval,
Stdin: os.Stdin,
Stdout: os.Stdout,
Stderr: os.Stderr,
OutputStyle: output,
OutputStyle: flags.output,
TaskSorter: taskSorter,
}
if (list || listAll) && silent {
e.ListTaskNames(listAll)
return
listOptions := task.NewListOptions(flags.list, flags.listAll, flags.listJson, flags.noStatus)
if err := listOptions.Validate(); err != nil {
return err
}
if (listOptions.ShouldListTasks()) && flags.silent {
e.ListTaskNames(flags.listAll)
return nil
}
if err := e.Setup(); err != nil {
log.Fatal(err)
}
v, err := e.Taskfile.ParsedVersion()
if err != nil {
log.Fatal(err)
return
return err
}
if list {
if ok := e.ListTasks(task.FilterOutInternal(), task.FilterOutNoDesc()); !ok {
e.Logger.Outf(logger.Yellow, "task: No tasks with description available. Try --list-all to list all tasks")
}
return
// If the download flag is specified, we should stop execution as soon as
// taskfile is downloaded
if flags.download {
return nil
}
if listAll {
if ok := e.ListTasks(task.FilterOutInternal()); !ok {
e.Logger.Outf(logger.Yellow, "task: No tasks available")
if listOptions.ShouldListTasks() {
foundTasks, err := e.ListTasks(listOptions)
if err != nil {
return err
}
return
if !foundTasks {
os.Exit(errors.CodeUnknown)
}
return nil
}
var (
calls []taskfile.Call
globals *taskfile.Vars
calls []ast.Call
globals *ast.Vars
)
tasksAndVars, cliArgs, err := getArgs()
if err != nil {
log.Fatal(err)
return err
}
if v >= 3.0 {
calls, globals = args.ParseV3(tasksAndVars...)
} else {
calls, globals = args.ParseV2(tasksAndVars...)
calls, globals = args.Parse(tasksAndVars...)
// If there are no calls, run the default task instead
if len(calls) == 0 {
calls = append(calls, ast.Call{Task: "default"})
}
globals.Set("CLI_ARGS", taskfile.Var{Static: cliArgs})
globals.Set("CLI_ARGS", ast.Var{Value: cliArgs})
globals.Set("CLI_FORCE", ast.Var{Value: flags.force || flags.forceAll})
e.Taskfile.Vars.Merge(globals)
if !watch {
if !flags.watch {
e.InterceptInterruptSignals()
}
ctx := context.Background()
if status {
if err := e.Status(ctx, calls...); err != nil {
log.Fatal(err)
}
return
if flags.status {
return e.Status(ctx, calls...)
}
if err := e.Run(ctx, calls...); err != nil {
e.Logger.Errf(logger.Red, "%v", err)
if exitCode {
if err, ok := err.(*task.TaskRunError); ok {
os.Exit(err.ExitCode())
}
}
os.Exit(1)
}
return e.Run(ctx, calls...)
}
func getArgs() ([]string, string, error) {
@@ -254,21 +344,3 @@ func getArgs() ([]string, string, error) {
}
return args[:doubleDashPos], strings.Join(quotedCliArgs, " "), nil
}
func getVersion() string {
if version != "" {
return version
}
info, ok := debug.ReadBuildInfo()
if !ok || info.Main.Version == "" {
return "unknown"
}
version = info.Main.Version
if info.Main.Sum != "" {
version += fmt.Sprintf(" (%s)", info.Main.Sum)
}
return version
}

View File

@@ -10,7 +10,7 @@ function __task_get_tasks --description "Prints all available tasks with their d
end
# Grab names and descriptions (if any) of the tasks
set -l output (echo $rawOutput | sed '1d; s/\* \(.*\):\s*\(.*\)/\1\t\2/' | string split0)
set -l output (echo $rawOutput | sed -e '1d; s/\* \(.*\):\s*\(.*\)\s*(aliases.*/\1\t\2/' -e 's/\* \(.*\):\s*\(.*\)/\1\t\2/'| string split0)
if test $output
echo $output
end

View File

@@ -1,8 +1,28 @@
$scriptBlock = {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters )
$reg = "\* ($commandName.+?):"
$listOutput = $(task --list-all)
$listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value }
}
using namespace System.Management.Automation
Register-ArgumentCompleter -CommandName task -ScriptBlock $scriptBlock
Register-ArgumentCompleter -CommandName task -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
if ($commandName.StartsWith('-')) {
$completions = @(
[CompletionResult]::new('--list-all ', '--list-all ', [CompletionResultType]::ParameterName, 'list all tasks'),
[CompletionResult]::new('--color ', '--color', [CompletionResultType]::ParameterName, '--color'),
[CompletionResult]::new('--concurrency=', '--concurrency=', [CompletionResultType]::ParameterName, 'concurrency'),
[CompletionResult]::new('--interval=', '--interval=', [CompletionResultType]::ParameterName, 'interval'),
[CompletionResult]::new('--output=interleaved ', '--output=interleaved', [CompletionResultType]::ParameterName, '--output='),
[CompletionResult]::new('--output=group ', '--output=group', [CompletionResultType]::ParameterName, '--output='),
[CompletionResult]::new('--output=prefixed ', '--output=prefixed', [CompletionResultType]::ParameterName, '--output='),
[CompletionResult]::new('--dry ', '--dry', [CompletionResultType]::ParameterName, '--dry'),
[CompletionResult]::new('--force ', '--force', [CompletionResultType]::ParameterName, '--force'),
[CompletionResult]::new('--parallel ', '--parallel', [CompletionResultType]::ParameterName, '--parallel'),
[CompletionResult]::new('--silent ', '--silent', [CompletionResultType]::ParameterName, '--silent'),
[CompletionResult]::new('--status ', '--status', [CompletionResultType]::ParameterName, '--status'),
[CompletionResult]::new('--verbose ', '--verbose', [CompletionResultType]::ParameterName, '--verbose'),
[CompletionResult]::new('--watch ', '--watch', [CompletionResultType]::ParameterName, '--watch')
)
return $completions.Where{ $_.CompletionText.StartsWith($commandName) }
}
return $(task --list-all --silent) | Where-Object { $_.StartsWith($commandName) } | ForEach-Object { return $_ + " " }
}

View File

@@ -18,7 +18,7 @@ function __task_list() {
enabled=1
cmd+=(--taskfile "$taskfile")
else
for taskfile in Taskfile{,.dist}.{yaml,yml}; do
for taskfile in {T,t}askfile{,.dist}.{yaml,yml}; do
if [[ -f "$taskfile" ]]; then
enabled=1
break
@@ -56,7 +56,7 @@ _arguments \
+ '(operation)' \
{-l,--list}'[list describable tasks]' \
{-a,--list-all}'[list all tasks]' \
{-i,--init}'[create new Taskfile.yaml]' \
{-i,--init}'[create new Taskfile.yml]' \
'(-*)'{-h,--help}'[show help]' \
'(-*)--version[show version and exit]' \
'*: :__task_list'

View File

@@ -1,4 +1,4 @@
version: '3'
version: "3"
tasks:
yarn:install:
@@ -14,7 +14,7 @@ tasks:
deps: [yarn:install]
aliases: [s, start]
vars:
HOST: '{{default "localhost" .HOST}}'
HOST: '{{default "0.0.0.0" .HOST}}'
PORT: '{{default "3001" .PORT}}'
cmds:
- npx docusaurus start --no-open --host={{.HOST}} --port={{.PORT}}
@@ -25,6 +25,16 @@ tasks:
cmds:
- npx docusaurus build
preview:
desc: Preview Website
deps: [build]
aliases: [serve]
vars:
HOST: '{{default "localhost" .HOST}}'
PORT: '{{default "3001" .PORT}}'
cmds:
- npx docusaurus serve --no-open --host={{.HOST}} --port={{.PORT}}
clean:
desc: Clean temp directories
cmds:
@@ -35,3 +45,20 @@ tasks:
summary: Requires GIT_USER and GIT_PASS envs to be previous set
cmds:
- npx docusaurus deploy
upgrade:
desc: Upgrade Docusaurus
cmds:
- yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@latest
crowdin:push:
desc: Upload source files to a Crowdin project
deps: [yarn:install]
cmds:
- npx crowdin push
crowdin:pull:
desc: Download latest translations from Crowdin to the specified place
deps: [yarn:install]
cmds:
- npx crowdin pull --export-only-approved

View File

@@ -1,3 +0,0 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};

3
docs/babel.config.ts Normal file
View File

@@ -0,0 +1,3 @@
export default {
presets: ['@docusaurus/core/lib/babel/preset'],
};

View File

@@ -0,0 +1,142 @@
---
title: Introducing Experiments
description:
A look at where task is, where it's going and how we're going to get there.
slug: task-in-2023
authors: [pd93]
tags: [experiments, breaking-changes, roadmap, v4]
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---
Lately, Task has been growing extremely quickly and I've found myself thinking a
lot about the future of the project and how we continue to evolve and grow. I'm
not much of a writer, but I think one of the things we could do better is to
communicate these kinds of thoughts to the community. So, with that in mind,
this is the first (hopefully of many) blog posts talking about Task and what
we're up to.
<!--truncate-->
## :calendar: So, what have we been up to?
Over the past 12 months or so, [@andreynering] (Author and maintainer of the
project) and I ([@pd93]) have been working in our spare time to maintain and
improve v3 of Task and we've made some amazing progress. Here are just some of
the things we've released in that time:
- An official [extension for VS Code][vscode-task].
- Internal Tasks ([#818](https://github.com/go-task/task/pull/818)).
- Task aliases ([#879](https://github.com/go-task/task/pull/879)).
- Looping over tasks ([#1220](https://github.com/go-task/task/pull/1200)).
- A series of refactors to the core codebase to make it more maintainable and
extensible.
- Loads of bug fixes and improvements.
- An integration with [Crowdin][crowdin]. Work is in progress on making our docs
available in **7 new languages** (Special thanks to all our translators for
the huge help with this!).
- And much, much more! :sparkles:
We're also working on adding some really exciting and highly requested features
to Task such as having the ability to run remote Taskfiles
([#1317](https://github.com/go-task/task/issues/1317)).
None of this would have been possible without the [150 or so (and growing)
contributors][contributors] to the project, numerous sponsors and a passionate
community of users. Together we have more than doubled the number of GitHub
stars to over 8400 :star: since the beginning of 2022 and this continues to
accelerate. We can't thank you all enough for your help and support! :rocket:
[![Star History Chart](https://api.star-history.com/svg?repos=go-task/task&type=Date)](https://star-history.com/#go-task/task&Date)
## What's next? :thinking:
It's extremely motivating to see so many people using and loving Task. However,
in this time we've also seen an increase in the number of issues and feature
requests. In particular, issues that require some kind of breaking change to
Task. This isn't a bad thing, but as we grow we need to be more responsible
about how we address these changes in a way that ensures stability and
compatibility for existing users and their Taskfiles.
At this point you're probably thinking something like:
> "But you use [semantic versioning][semver] - Just release a new major version
> with your breaking changes."
And you'd be right... sort of. In theory, this sounds great, but the reality is
that we don't have the time to commit to a major overhaul of Task in one big
bang release. This would require a colossal amount of time and coordination and
with full time jobs and personal lives to tend to, this is a difficult
commitment to make. Smaller, more frequent major releases are also a significant
inconvenience for users as they have to constantly keep up-to-date with our
breaking changes. Fortunately, there is a better way.
## What's going to change? :monocle:
Going forwards, breaking changes will be allowed into _minor_ versions of Task
as "experimental features". To access these features users will need opt-in by
enabling feature flags. This will allow us to release new features slowly and
gather feedback from the community before making them the default behavior in a
future major release.
To prepare users for the next major release, we will maintain a list of
[deprecated features][deprecations] and [experiments][experiments] on our docs
website and publish information on how to migrate to the new behavior.
You can read the [full breaking change proposal][breaking-change-proposal] and
view all the [current experiments and their status][experiments-project] on
GitHub including the [Gentle Force][gentle-force-experiment] and [Remote
Taskfiles][remote-taskfiles-experiment] experiments.
## What will happen to v2/v3 features?
v2 has been [officially deprecated][deprecate-version-2-schema]. If you're still
using a Taskfile with `version: "2"` at the top we _strongly recommend_ that you
upgrade as soon as possible. Removing v2 will allow us to tidy up the codebase
and focus on new functionality instead.
When v4 is released, we will continue to support v3 for a period of time (bug
fixes etc). However, since we are moving from a backward-compatibility model to
a forwards-compatibility model, **v4 itself will not be backwards compatible
with v3**.
## v4 When? :eyes:
:man_shrugging: When it's ready.
In all seriousness, we don't have a timeline for this yet. We'll be working on
the most serious deficiencies of the v3 API first and regularly evaluating the
state of the project. When we feel its in a good, stable place and we have a
clear upgrade path for users and a number of stable experiments, we'll start to
think about v4.
## :wave: Final thoughts
Task is growing fast and we're excited to see where it goes next. We hope that
the steps we're taking to improve the project and our process will help us to
continue to grow. As always, if you have any questions or feedback, we encourage
you to comment on or open [issues][issues] and [discussions][discussions] on
GitHub. Alternatively, you can join us on [Discord][discord].
I plan to write more of these blog posts in the future on a variety of
Task-related topics, so make sure to check in occasionally and see what we're up
to!
<!-- prettier-ignore-start -->
[vscode-task]: https://github.com/go-task/vscode-task
[crowdin]: https://crowdin.com
[contributors]: https://github.com/go-task/task/graphs/contributors
[semver]: https://semver.org
[breaking-change-proposal]: https://github.com/go-task/task/discussions/1191
[@andreynering]: https://github.com/andreynering
[@pd93]: https://github.com/pd93
[experiments]: https://taskfile.dev/experiments
[deprecations]: https://taskfile.dev/deprecations
[deprecate-version-2-schema]: https://github.com/go-task/task/issues/1197
[issues]: https://github.com/go-task/task/issues
[discussions]: https://github.com/go-task/task/discussions
[discord]: https://discord.gg/6TY36E39UK
[experiments-project]: https://github.com/orgs/go-task/projects/1
[gentle-force-experiment]: https://github.com/go-task/task/issues/1200
[remote-taskfiles-experiment]: https://github.com/go-task/task/issues/1317
<!-- prettier-ignore-end -->

View File

@@ -3,3 +3,8 @@ andreynering:
title: Maintainer of Task
url: https://github.com/andreynering
image_url: https://github.com/andreynering.png
pd93:
name: Pete Davison
title: Maintainer of Task
url: https://github.com/pd93
image_url: https://github.com/pd93.png

View File

@@ -1,11 +0,0 @@
const GITHUB_URL = 'https://github.com/go-task/task';
const TWITTER_URL = 'https://twitter.com/taskfiledev';
const DISCORD_URL = 'https://discord.gg/6TY36E39UK';
const CHINESE_URL = 'https://task-zh.readthedocs.io/zh_CN/latest/';
module.exports = {
GITHUB_URL,
TWITTER_URL,
DISCORD_URL,
CHINESE_URL
};

4
docs/constants.ts Normal file
View File

@@ -0,0 +1,4 @@
export const GITHUB_URL = 'https://github.com/go-task/task';
export const TWITTER_URL = 'https://twitter.com/taskfiledev';
export const MASTODON_URL = 'https://fosstodon.org/@task';
export const DISCORD_URL = 'https://discord.gg/6TY36E39UK';

15
docs/crowdin.yml Normal file
View File

@@ -0,0 +1,15 @@
project_id: "574591"
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: true
files:
- source: /docs/**/*
translation: /i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%
ignore:
- /**/*.json
- source: /blog/**/*
translation: /i18n/%locale%/docusaurus-plugin-content-blog/**/%original_file_name%
- source: /i18n/en/**/*.json
translation: /i18n/%locale%/**/%original_file_name%

View File

@@ -1,6 +1,8 @@
---
slug: /api/
sidebar_position: 4
toc_min_heading_level: 2
toc_max_heading_level: 5
---
# API Reference
@@ -15,97 +17,175 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
:::tip
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS`
variable
If `--` is given, all remaining arguments will be assigned to a special
`CLI_ARGS` variable
:::
| Short | Flag | Type | Default | Description |
| - | - | - | - | - |
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yaml in the current folder. |
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
| | `--summary` | `bool` | `false` | Show summary about a task. |
| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | |
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
| | `--version` | `bool` | `false` | Show Task version. |
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
| Short | Flag | Type | Default | Description |
| ----- | --------------------------- | -------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. |
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
| | `--sort` | `string` | `default` | Changes the order of the tasks when listed.<br />`default` - Alphanumeric with root tasks first<br />`alphanumeric` - Alphanumeric<br />`none` - No sorting (As they appear in the Taskfile) |
| | `--json` | `bool` | `false` | See [JSON Output](#json-output) |
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. |
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. |
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
| | `--summary` | `bool` | `false` | Show summary about a task. |
| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | |
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
| | `--version` | `bool` | `false` | Show Task version. |
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
## Exit Codes
Task will sometimes exit with specific exit codes. These codes are split into
three groups with the following ranges:
- General errors (0-99)
- Taskfile errors (100-199)
- Task errors (200-299)
A full list of the exit codes and their descriptions can be found below:
| Code | Description |
| ---- | ------------------------------------------------------------ |
| 0 | Success |
| 1 | An unknown error occurred |
| 100 | No Taskfile was found |
| 101 | A Taskfile already exists when trying to initialize one |
| 102 | The Taskfile is invalid or cannot be parsed |
| 103 | A remote Taskfile could not be downloaded |
| 104 | A remote Taskfile was not trusted by the user |
| 105 | A remote Taskfile was could not be fetched securely |
| 106 | No cache was found for a remote Taskfile in offline mode |
| 107 | No schema version was defined in the Taskfile |
| 200 | The specified task could not be found |
| 201 | An error occurred while executing a command inside of a task |
| 202 | The user tried to invoke a task that is internal |
| 203 | There a multiple tasks with the same name or alias |
| 204 | A task was called too many times |
| 205 | A task was cancelled by the user |
| 206 | A task was not executed due to missing required variables |
These codes can also be found in the repository in
[`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
:::info
When Task is run with the `-x`/`--exit-code` flag, the exit code of any failed
commands will be passed through to the user instead.
:::
## JSON Output
When using the `--json` flag in combination with either the `--list` or
`--list-all` flags, the output will be a JSON object with the following
structure:
```json
{
"tasks": [
{
"name": "",
"desc": "",
"summary": "",
"up_to_date": false,
"location": {
"line": 54,
"column": 3,
"taskfile": "/path/to/Taskfile.yml"
}
}
// ...
],
"location": "/path/to/Taskfile.yml"
}
```
## Special Variables
There are some special variables that is available on the templating system:
| Var | Description |
| - | - |
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
| `TASK` | The name of the current task. |
| `ROOT_DIR` | The absolute path of the root Taskfile. |
| `TASKFILE_DIR` | The absolute path of the included Taskfile. |
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
| `TIMESTAMP` | The date object of the greatest timestamp of the files listes in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
| Var | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
| `CLI_FORCE` | A boolean containing whether the `--force` or `--force-all` flags were set. |
| `TASK` | The name of the current task. |
| `ROOT_TASKFILE` | The absolute path of the root Taskfile. |
| `ROOT_DIR` | The absolute path of the root Taskfile directory. |
| `TASKFILE_DIR` | The absolute path of the included Taskfile directory. |
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
| `TASK_VERSION` | The current version of task. |
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
## ENV
Some environment variables can be overriden to adjust Task behavior.
Some environment variables can be overridden to adjust Task behavior.
| ENV | Default | Description |
| - | - | - |
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
| `TASK_COLOR_RESET` | `0` | Color used for white. |
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
| `TASK_COLOR_RED` | `31` | Color used for red. |
| ENV | Default | Description |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
| `TASK_COLOR_RESET` | `0` | Color used for white. |
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
| `TASK_COLOR_RED` | `31` | Color used for red. |
| `FORCE_COLOR` | | Force color output usage. |
## Schema
## Taskfile Schema
### Taskfile
| Attribute | Type | Default | Description |
| - | - | - | - |
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| Attribute | Type | Default | Description |
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
### Include
| Attribute | Type | Default | Description |
| - | - | - | - |
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
| Attribute | Type | Default | Description |
| ---------- | --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
Informing only a string like below is equivalent to setting that value to the
`taskfile` attribute.
```yaml
includes:
@@ -114,31 +194,57 @@ includes:
:::
### Variable
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------ |
| _itself_ | `string` | | A static value that will be set to the variable. |
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
vars:
STATIC: static
DYNAMIC:
sh: echo "dynamic"
```
:::
### Task
| Attribute | Type | Default | Description |
| - | - | - | - |
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
| Attribute | Type | Default | Description |
| --------------- | ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `prompt` | `string` | | A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
| `requires` | `[]string` | | A list of variables which should be set if this task is to run, if any of these variables are unset the task will error and not run. |
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
| `requires` | [`Requires`](#requires) | | A list of required variables which should be set if this task is to run, if any variables listed are unset the task will error and not run. |
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the task should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/main/src/go/build/syslist.go). Task will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
@@ -159,36 +265,20 @@ tasks:
:::
### Dependency
#### Command
| Attribute | Type | Default | Description |
| - | - | - | - |
| `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
:::tip
If you don't want to set additional variables, it's enough to declare the
dependency as a list of strings (they will be assigned to `task`):
```yaml
tasks:
foo:
deps: [foo, bar]
```
:::
### Command
| Attribute | Type | Default | Description |
| - | - | - | - |
| `cmd` | `string` | | The shell command to be executed. |
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
| Attribute | Type | Default | Description |
| -------------- | ---------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmd` | `string` | | The shell command to be executed. |
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
| `for` | [`For`](#for) | | Runs the command once for each given value. |
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the command should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/main/src/go/build/syslist.go). Command will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
@@ -204,32 +294,53 @@ tasks:
:::
### Variable
#### Dependency
| Attribute | Type | Default | Description |
| - | - | - | - |
| *itself* | `string` | | A static value that will be set to the variable. |
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
| Attribute | Type | Default | Description |
| --------- | ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
:::info
:::tip
Static and dynamic variables have different syntaxes, like below:
If you don't want to set additional variables, it's enough to declare the
dependency as a list of strings (they will be assigned to `task`):
```yaml
vars:
STATIC: static
DYNAMIC:
sh: echo "dynamic"
tasks:
foo:
deps: [foo, bar]
```
:::
### Precondition
#### For
| Attribute | Type | Default | Description |
| - | - | - | - |
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
The `for` parameter can be defined as a string, a list of strings or a map. If
it is defined as a string, you can give it any of the following values:
- `source` - Will run the command for each source file defined on the task.
(Glob patterns will be resolved, so `*.go` will run for every Go file that
matches).
If it is defined as a list of strings, the command will be run for each value.
Finally, the `for` parameter can be defined as a map when you want to use a
variable to define the values to loop over:
| Attribute | Type | Default | Description |
| --------- | -------- | ---------------- | -------------------------------------------- |
| `var` | `string` | | The name of the variable to use as an input. |
| `split` | `string` | (any whitespace) | What string the variable should be split on. |
| `as` | `string` | `ITEM` | The name of the iterator variable. |
#### Precondition
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
:::tip
@@ -243,3 +354,9 @@ tasks:
```
:::
#### Requires
| Attribute | Type | Default | Description |
| --------- | ---------- | ------- | -------------------------------------------------------------------------------------------------- |
| `vars` | `[]string` | | List of variable or environment variable names that must be set if this task is to execute and run |

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +1,43 @@
---
slug: /community/
sidebar_position: 6
sidebar_position: 9
---
# Community
Some of the work to improve the Task ecosystem is done by the community, be
it installation methods or integrations with code editor. I (the author) am
Some of the work to improve the Task ecosystem is done by the community, be it
installation methods or integrations with code editor. I (the author) am
thankful for everyone that helps me to improve the overall experience.
## Translations
[@DeronW](https://github.com/DeronW) maintains the
[Chinese translation](https://task-zh.readthedocs.io/zh_CN/latest/) of the
website [on this repository](https://github.com/DeronW/task).
We use [Crowdin](https://crowdin.com/project/taskfile) to translate our
document.
## Editor Integrations
## Integrations
### JSON Schema
Initial work on the schema was made by [@KROSF](https://github.com/KROSF)
on [this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895).
The schema is currently available at
https://taskfile.dev/schema.json and linked at https://json.schemastore.org/taskfile.json
so it is be used automatically many code editors, like VSCode.
Contributions can be done by editing [this file](https://github.com/go-task/task/blob/master/docs/static/schema.json).
### Visual Studio Code extension
Additionally, there's also some work done by
[@paulvarache](https://github.com/paulvarache) in making an Visual Studio Code
extension, which has its code [here](https://github.com/paulvarache/vscode-taskfile)
and is published [here](https://marketplace.visualstudio.com/items?itemName=paulvarache.vscode-taskfile).
### Sublime Text 4 package
There is a convenience wrapper for initializing and running tasks from Sublime Text's command palette. The package is
developed by [@biozz](https://github.com/biozz), the source code is available [here](https://github.com/biozz/sublime-taskfile)
and it is published on Package Control [here](https://packagecontrol.io/packages/Taskfile).
### IntelliJ plugin
There's a JetBrains IntelliJ plugin done by
[@lechuckroh](https://github.com/lechuckroh), which has its code [here](https://github.com/lechuckroh/task-intellij-plugin)
and is published [here](https://plugins.jetbrains.com/plugin/17058-taskfile).
Many of our integrations are contributed and maintained by the community. You
can view the full list of community integrations
[here](/integrations#community-integrations).
## Installation methods
Some installation methods are maintained by third party:
- [GitHub Actions](https://github.com/arduino/setup-task)
by [@arduino](https://github.com/arduino)
- [AUR](https://aur.archlinux.org/packages/go-task-bin)
by [@carlsmedstad](https://github.com/carlsmedstad)
- [Scoop](https://github.com/lukesampson/scoop-extras/blob/master/bucket/task.json)
- [GitHub Actions](https://github.com/arduino/setup-task) by @arduino
- [AUR](https://aur.archlinux.org/packages/go-task-bin) by @carlsmedstad
- [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)
- [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
- [NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/go-task/default.nix)
- [Conda](https://github.com/conda-forge/go-task-feedstock/)
## More
Also, thanks for all the [code contributors](https://github.com/go-task/task/graphs/contributors),
Also, thanks for all the
[code contributors](https://github.com/go-task/task/graphs/contributors),
[financial contributors](https://opencollective.com/task), all those who
[reported bugs](https://github.com/go-task/task/issues?q=is%3Aissue) and
[answered questions](https://github.com/go-task/task/discussions).
If you know something that is missing in this document, please submit a
pull request.
If you know something that is missing in this document, please submit a pull
request.

View File

@@ -1,6 +1,6 @@
---
slug: /contributing/
sidebar_position: 7
sidebar_position: 11
---
# Contributing
@@ -8,31 +8,47 @@ sidebar_position: 7
Contributions to Task are very welcome, but we ask that you read this document
before submitting a PR.
:::note
This document applies to the core [Task][task] repository _and_ [Task for Visual
Studio Code][vscode-task].
:::
## Before you start
- **Check existing work** - Is there an existing PR? Are there issues discussing
the feature/change you want to make? Please make sure you consider/address these
discussions in your work.
the feature/change you want to make? Please make sure you consider/address
these discussions in your work.
- **Backwards compatibility** - Will your change break existing Taskfiles? It is
much more likely that your change will merged if it backwards compatible. Is
there an approach you can take that maintains this compatibility? If not,
consider opening an issue first so that API changes can be discussed before you
invest you time into a PR.
much more likely that your change will merged if it backwards compatible. Is
there an approach you can take that maintains this compatibility? If not,
consider opening an issue first so that API changes can be discussed before
you invest your time into a PR.
- **Experiments** - If there is no way to make your change backward compatible
then there is a procedure to introduce breaking changes into minor versions.
We call these "[experiments][experiments]". If you're intending to work on an
experiment, then please read the [experiments workflow][experiments-workflow]
document carefully and submit a proposal first.
## 1. Setup
- **Go** - Task is written in [Go]. We always support the latest two major Go
versions, so make sure your version is recent enough.
- **Node.js** - [Node.js] is used to host Task's documentation server and is
required if you want to run this server locally.
- **Yarn** - [Yarn] is the Node.js package manager used by Task.
- **Go** - Task is written in [Go][go]. We always support the latest two major
Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js][nodejs] is used to host Task's documentation server
and is required if you want to run this server locally. It is also required if
you want to contribute to the Visual Studio Code extension.
- **Yarn** - [Yarn][yarn] is the Node.js package manager used by Task.
## 2. Making changes
- **Code style** - Try to maintain the existing code style where possible and
ensure that code is formatted by `gofmt`. We use `golangci-lint` in our CI to
enforce a consistent style and best-practise. There's a `lint` command in
the Taskfile to run this locally.
- **Code style** - Try to maintain the existing code style where possible. Go
code should be formatted by [`gofumpt`][gofumpt] and linted using
[`golangci-lint`][golangci-lint]. Any Markdown or TypeScript files should be
formatted and linted by [Prettier][prettier]. This style is enforced by our CI
to ensure that we have a consistent style across the project. You can use the
`task lint` command to lint the code locally and the `task lint:fix` command
to automatically fix any issues that are found.
- **Documentation** - Ensure that you add/update any relevant documentation. See
the [updating documentation](#updating-documentation) section below.
- **Tests** - Ensure that you add/update any relevant tests and that all tests
@@ -42,46 +58,61 @@ invest you time into a PR.
### Running your changes
To run Task with working changes, you can use `go run ./cmd/task`. To run a
development build of task against a test Taskfile in `testdata`, you can use `go
run ./cmd/task --dir ./testdata/<my_test_dir> <task_name>`.
development build of task against a test Taskfile in `testdata`, you can use
`go run ./cmd/task --dir ./testdata/<my_test_dir> <task_name>`.
To run Task for Visual Studio Code, you can open the project in VSCode and hit
F5 (or whatever you debug keybind is set to). This will open a new VSCode window
with the extension running. Debugging this way is recommended as it will allow
you to set breakpoints and step through the code. Otherwise, you can run
`task package` which will generate a `.vsix` file that can be used to manually
install the extension.
### Updating documentation
Task uses [Docusaurus] to host a documentation server. This can be setup and run
locally by using `task docs:setup` and `task docs:start` respectively (requires
`nodejs` & `yarn`). All content is written in Markdown and is located in the
`docs/docs` directory. All Markdown documents should have an 80 character line
wrap limit.
Task uses [Docusaurus][docusaurus] to host a documentation server. The code for
this is located in the core Task repository. This can be setup and run locally
by using `task docs` (requires `nodejs` & `yarn`). All content is written in
Markdown and is located in the `docs/docs` directory. All Markdown documents
should have an 80 character line wrap limit (enforced by Prettier).
When making a change, consider whether a change to the [Usage Guide](./usage.md)
is necessary. This document contains descriptions and examples of how to use
Task features. If you're adding a new feature, try to find an appropriate place
to add a new section. If you're updating an existing feature, ensure that the
documentation and any examples are up-to-date. Ensure that any examples follow
the [Taskfile Styleguide](./styleguide.md).
When making a change, consider whether a change to the [Usage
Guide](/usage) is necessary. This document contains descriptions and
examples of how to use Task features. If you're adding a new feature, try to
find an appropriate place to add a new section. If you're updating an existing
feature, ensure that the documentation and any examples are up-to-date. Ensure
that any examples follow the [Taskfile Styleguide](/styleguide).
If you added a new field, command or flag, ensure that you add it to the [API
Reference](./api_reference.md). New fields also need to be added to the
[JSON Schema](../static/schema.json). The descriptions for fields in the API
reference and the schema should match.
If you added a new field, command or flag, ensure that you add it to the
[API Reference](/api). New fields also need to be added to the
[JSON Schema][json-schema]. The descriptions for fields in the API reference and
the schema should match.
### Writing tests
Most of Task's test are held in the `task_test.go` file in the project root and
this is where you'll most likely want to add new ones too. Most of these tests
also have a subdirectory in the `testdata` directory where any Taskfiles/data
required to run the tests are stored.
A lot of Task's tests are held in the `task_test.go` file in the project root
and this is where you'll most likely want to add new ones too. Most of these
tests also have a subdirectory in the `testdata` directory where any
Taskfiles/data required to run the tests are stored.
When making a changes, consider whether new tests are required. These tests
should ensure that the functionality you are adding will continue to work in the
future. Existing tests may also need updating if you have changed Task's
behaviour.
behavior.
You may also consider adding unit tests for any new functions you have added.
The unit tests should follow the Go convention of being location in a file named
`*_test.go` in the same package as the code being tested.
## 3. Committing your code
Try to write meaningful commit messages and avoid having too many commits on
the PR. Most PRs should likely have a single commit (although for bigger PRs it
may be reasonable to split it in a few). Git squash and rebase is your friend!
Try to write meaningful commit messages and avoid having too many commits on the
PR. Most PRs should likely have a single commit (although for bigger PRs it may
be reasonable to split it in a few). Git squash and rebase is your friend!
If you're not sure how to format your commit message, check out [Conventional
Commits][conventional-commits]. This style is not enforced, but it is a good way
to make your commit messages more readable and consistent.
## 4. Submitting a PR
@@ -89,8 +120,8 @@ may be reasonable to split it in a few). Git squash and rebase is your friend!
description of your changes.
- **Issue/PR links** - Link any previous work such as related issues or PRs.
Please describe how your changes differ to/extend this work.
- **Examples** - Add any examples that you think are useful to demonstrate the
effect of your changes.
- **Examples** - Add any examples or screenshots that you think are useful to
demonstrate the effect of your changes.
- **Draft PRs** - If your changes are incomplete, but you would like to discuss
them, open the PR as a draft and add a comment to start a discussion. Using
comments rather than the PR description allows the description to be updated
@@ -100,25 +131,37 @@ may be reasonable to split it in a few). Git squash and rebase is your friend!
> I want to contribute, where do I start?
Take a look at the list of [open issues]. We have a [good first issue] label for
simpler issues that are ideal for first time contributions.
Take a look at the list of [open issues for Task][task-open-issues] or [Task for
Visual Studio Code][vscode-task-open-issues]. We have a [good first
issue][good-first-issue] label for simpler issues that are ideal for first time
contributions.
All kinds of contributions are welcome, whether its a typo fix or a shiny new
feature. You can also contribute by upvoting/commenting on issues, helping to
answer questions or contributing to other [community projects](./community.md).
answer questions or contributing to other [community projects](/community).
> I'm stuck, where can I get help?
If you have questions, feel free to ask them in the `#help` channel on our
[Discord server].
If you have questions, feel free to ask them in the `#help` forum channel on our
[Discord server][discord-server] or open a [Discussion][discussion] on GitHub.
---
[Go]: https://go.dev
[install version 1.18+]: https://go.dev/doc/install
[Node.js]: https://nodejs.org/en/
[Yarn]: https://yarnpkg.com/
[Docusaurus]: https://docusaurus.io
[open issues]: https://github.com/go-task/task/issues
[good first issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[Discord server]: https://discord.gg/6TY36E39UK
<!-- prettier-ignore-start -->
[task]: https://github.com/go-task/task
[vscode-task]: https://github.com/go-task/vscode-task
[go]: https://go.dev
[gofumpt]: https://github.com/mvdan/gofumpt
[golangci-lint]: https://golangci-lint.run
[prettier]: https://prettier.io
[nodejs]: https://nodejs.org/en/
[yarn]: https://yarnpkg.com/
[docusaurus]: https://docusaurus.io
[json-schema]: https://github.com/go-task/task/blob/main/docs/static/schema.json
[task-open-issues]: https://github.com/go-task/task/issues
[vscode-task-open-issues]: https://github.com/go-task/vscode-task/issues
[good-first-issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[discord-server]: https://discord.gg/6TY36E39UK
[discussion]: https://github.com/go-task/task/discussions
[conventional-commits]: https://www.conventionalcommits.org
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,19 @@
---
slug: /deprecations/
sidebar_position: 7
---
# Deprecations
As Task evolves, it occasionally outgrows some of its functionality. This can be
because they are no longer useful, because another feature has replaced it or
because of a change in the way that Task works internally.
When this happens, we mark the functionality as deprecated. This means that it
will be removed in a future version of Task. This functionality will continue to
work until that time, but we strongly recommend that you do not implement this
functionality in new Taskfiles and make a plan to migrate away from it as soon
as possible.
You can view a full list of active deprecations in the "Deprecations" section of
the sidebar.

View File

@@ -0,0 +1,23 @@
---
# This is a template for an experiments documentation
# Copy this page and fill in the details as necessary
title: '--- Template ---'
sidebar_position: -1 # Always push to the top
draft: true # Hide in production
---
# \{Name of Deprecated Feature\} (#\{Issue\})
:::warning
This deprecation breaks the following functionality:
- \{list any existing functionality that will be broken by this deprecation\}
- \{if there are no breaking changes, remove this admonition\}
:::
\{Short description of the feature/behavior and why it is being deprecated\}
\{Short explanation of any replacement features/behaviors and how users should
migrate to it\}

View File

@@ -0,0 +1,33 @@
---
slug: /deprecations/version-2-schema/
---
# Version 2 Schema (#1197)
:::warning
This deprecation breaks the following functionality:
- Any Taskfiles that use the version 2 schema
- `Taskvar.yml` files
:::
The Taskfile version 2 schema was introduced in March 2018 and replaced by
version 3 in August 2019. In May 2023 [we published a deprecation
notice][deprecation-notice] for the version 2 schema on the basis that the vast
majority of users had already upgraded to version 3 and removing support for
version 2 would allow us to tidy up the codebase and focus on new functionality
instead.
In December 2023, the final version of Task that supports the version 2 schema
([v3.33.0][v3.33.0]) was published and all legacy code was removed from Task's
main branch. To use a more recent version of Task, you will need to ensure that
your Taskfile uses the version 3 schema instead. A list of changes between
version 2 and version 3 are available in the [Task v3 Release Notes][v3.0.0].
<!-- prettier-ignore-start -->
[v3.0.0]: https://github.com/go-task/task/releases/tag/v3.0.0
[v3.33.0]: https://github.com/go-task/task/releases/tag/v3.33.0
[deprecation-notice]: https://github.com/go-task/task/issues/1197
<!-- prettier-ignore-end -->

View File

@@ -1,6 +1,6 @@
---
slug: /donate/
sidebar_position: 10
sidebar_position: 16
---
# Donate
@@ -11,10 +11,24 @@ channels listed below.
This is just a way of saying "thank you", it won't give you any benefits like
higher priority on issues or something similar.
Companies who donate at least $50/month will be featured as a "Gold Sponsor" in
the website homepage and on the GitHub repository README. Make contact with
[@andreynering] with the logo you want to be shown. Suspect businesses
(gambling, casinos, etc) won't be allowed, though.
## GitHub Sponsors
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use
the following links to do your donation. We suggest a 50/50 split to each
maintainer of the total amount you plan to donate to the project.
- [@andreynering](https://github.com/sponsors/andreynering)
- [@pd93](https://github.com/sponsors/pd93)
## Open Collective
Task is on [Open Collective](https://opencollective.com/task) and you have
these options to donate:
If you prefer [Open Collective](https://opencollective.com/task) you can donate
by using these links:
- [$2 per month](https://opencollective.com/task/contribute/backer-4034/checkout)
- [$5 per month](https://opencollective.com/task/contribute/supporter-8404/checkout)
@@ -22,15 +36,17 @@ these options to donate:
- [$50 per month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
- [Custom value - One-time donation option supported](https://opencollective.com/task/donate)
## GitHub Sponsors
- [@andreynering](https://github.com/sponsors/andreynering)
## PayPal
You can donate to [@andreynering] via PayPal as well:
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
## PIX (Brazil only)
If you're Brazilian, you can donate any value by
And if you're Brazilian, you can also donate to [@andreynering] via PIX by
[using this QR Code](/img/pix.png).
<!-- prettier-ignore-start -->
[@andreynering]: https://github.com/andreynering
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,346 @@
---
slug: /experiments/any-variables/
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Any Variables (#1415)
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
Currently, Task only supports string variables. This experiment allows you to
specify and use the following variable types:
- `string`
- `bool`
- `int`
- `float`
- `array`
- `map`
This allows you to have a lot more flexibility in how you use variables in
Task's templating engine. There are two active proposals for this experiment.
Click on the tabs below to switch between them.
<Tabs defaultValue="1" queryString="proposal"
values={[
{label: 'Proposal 1', value: '1'},
{label: 'Proposal 2', value: '2'}
]}>
<TabItem value="1">
:::warning
This experiment proposal breaks the following functionality:
- Dynamically defined variables (using the `sh` keyword)
:::
:::info
To enable this experiment, set the environment variable:
`TASK_X_ANY_VARIABLES=1`. Check out [our guide to enabling experiments
][enabling-experiments] for more information.
:::
## Maps
This proposal removes support for the `sh` keyword in favour of a new syntax for
dynamically defined variables, This allows you to define a map directly as you
would for any other type:
```yaml
version: 3
tasks:
foo:
vars:
FOO: {a: 1, b: 2, c: 3} # <-- Directly defined map on the `FOO` key
cmds:
- 'echo {{.FOO.a}}'
```
## Migration
Taskfiles with dynamically defined variables via the `sh` subkey will no longer
work with this experiment enabled. In order to keep using dynamically defined
variables, you will need to migrate your Taskfile to use the new syntax.
Previously, you might have defined a dynamic variable like this:
```yaml
version: 3
tasks:
foo:
vars:
CALCULATED_VAR:
sh: 'echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
With this experiment enabled, you will need to remove the `sh` subkey and define
your command as a string that begins with a `$`. This will instruct Task to
interpret the string as a command instead of a literal value and the variable
will be populated with the output of the command. For example:
```yaml
version: 3
tasks:
foo:
vars:
CALCULATED_VAR: '$echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
If your current Taskfile contains a string variable that begins with a `$`, you
will now need to escape the `$` with a backslash (`\`) to stop Task from
executing it as a command.
</TabItem>
<TabItem value="2">
:::info
To enable this experiment, set the environment variable:
`TASK_X_ANY_VARIABLES=2`. Check out [our guide to enabling experiments
][enabling-experiments] for more information.
:::
## Maps
This proposal maintains backwards-compatibility and the `sh` subkey and adds
another new `map` subkey for defining map variables:
```yaml
version: 3
tasks:
foo:
vars:
FOO:
map: {a: 1, b: 2, c: 3} # <-- Defined using the `map' subkey instead of directly on 'FOO'
BAR: true # <-- Other types of variables are still defined directly on the key
BAZ:
sh: 'echo Hello Task' # <-- The `sh` subkey is still supported
cmds:
- 'echo {{.FOO.a}}'
```
## Parsing JSON and YAML
In addition to the new `map` keyword, this proposal also adds support for the
`json` and `yaml` keywords for parsing JSON and YAML strings into real
objects/arrays. This is similar to the `fromJSON` template function, but means
that you only have to parse the JSON/YAML once when you declare the variable,
instead of every time you want to access a value.
Before:
```yaml
version: 3
tasks:
foo:
vars:
FOO: '{"a": 1, "b": 2, "c": 3}' # <-- JSON string
cmds:
- 'echo {{(fromJSON .FOO).a}}' # <-- Parse JSON string every time you want to access a value
- 'echo {{(fromJSON .FOO).b}}'
```
After:
```yaml
version: 3
tasks:
foo:
vars:
FOO:
json: '{"a": 1, "b": 2, "c": 3}' # <-- JSON string parsed once
cmds:
- 'echo {{.FOO.a}}' # <-- Access values directly
- 'echo {{.FOO.b}}'
```
## Variables by reference
Lastly, this proposal adds support for defining and passing variables by
reference. This is really important now that variables can be types other than a
string. Previously, to send a variable from one task to another, you would have
to use the templating system to pass it:
```yaml
version: 3
tasks:
foo:
vars:
FOO: [A, B, C] # <-- FOO is defined as an array
cmds:
- task: bar
vars:
FOO: '{{.FOO}}' # <-- FOO gets converted to a string when passed to bar
bar:
cmds:
- 'echo {{index .FOO 0}}' # <-- FOO is a string so the task outputs '91' which is the ASCII code for '[' instead of the expected 'A'
```
Unfortunately, this results in the value always being passed as a string as this
is the output type of the templater and operations on the passed variable may
not behave as expected. With this proposal, you can now pass variables by
reference using the `ref` subkey:
```yaml
version: 3
tasks:
foo:
vars:
FOO: [A, B, C] # <-- FOO is defined as an array
cmds:
- task: bar
vars:
FOO:
ref: FOO # <-- FOO gets passed by reference to bar and maintains its type
bar:
cmds:
- 'echo {{index .FOO 0}}' # <-- FOO is still a map so the task outputs 'A' as expected
```
This means that the type of the variable is maintained when it is passed to
another Task. This also works the same way when calling `deps` and when defining
a variable and can be used in any combination:
```yaml
version: 3
tasks:
foo:
vars:
FOO: [A, B, C] # <-- FOO is defined as an array
BAR:
ref: FOO # <-- BAR is defined as a reference to FOO
deps:
- task: bar
vars:
BAR:
ref: BAR # <-- BAR gets passed by reference to bar and maintains its type
bar:
cmds:
- 'echo {{index .BAR 0}}' # <-- BAR still refers to FOO so the task outputs 'A'
```
</TabItem></Tabs>
---
## Common to both proposals
Both proposals add support for all other variable types by directly defining
them in the Taskfile. For example:
### Evaluating booleans
```yaml
version: 3
tasks:
foo:
vars:
BOOL: false
cmds:
- '{{if .BOOL}}echo foo{{end}}'
```
### Arithmetic
```yaml
version: 3
tasks:
foo:
vars:
INT: 10
FLOAT: 3.14159
cmds:
- 'echo {{add .INT .FLOAT}}'
```
### Ranging
```yaml
version: 3
tasks:
foo:
vars:
ARRAY: [1, 2, 3]
cmds:
- 'echo {{range .ARRAY}}{{.}}{{end}}'
```
There are many more templating functions which can be used with the new types of
variables. For a full list, see the [slim-sprig][slim-sprig] documentation.
## Looping over variables
Previously, you would have to use a delimiter separated string to loop over an
arbitrary list of items in a variable and split them by using the `split` subkey
to specify the delimiter:
```yaml
version: 3
tasks:
foo:
vars:
LIST: 'foo,bar,baz'
cmds:
- for:
var: LIST
split: ','
cmd: echo {{.ITEM}}
```
Both of these proposals add support for looping over "collection-type" variables
using the `for` keyword, so now you are able to loop over a map/array variable
directly:
```yaml
version: 3
tasks:
foo:
vars:
LIST: [foo, bar, baz]
cmds:
- for:
var: LIST
cmd: echo {{.ITEM}}
```
When looping over a map we also make an additional `{{.KEY}}` variable availabe
that holds the string value of the map key. Remember that maps are unordered, so
the order in which the items are looped over is random.
<!-- prettier-ignore-start -->
[enabling-experiments]: /experiments/#enabling-experiments
[slim-sprig]: https://go-task.github.io/slim-sprig/
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,131 @@
---
slug: /experiments/
sidebar_position: 6
---
# Experiments
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
In order to allow Task to evolve quickly, we sometimes roll out breaking changes
to minor versions behind experimental flags. This allows us to gather feedback
on breaking changes before committing to a major release. This process can also
be used to gather feedback on important non-breaking features before their
design is completed. This document describes the
[experiment workflow](#workflow) and how you can get involved.
You can view the full list of active experiments in the sidebar submenu to the
left of the page and click on each one to find out more about it.
## Enabling Experiments
Task uses environment variables to detect whether or not an experiment is
enabled. All of the experiment variables will begin with the same `TASK_X_`
prefix followed by the name of the experiment. You can find the exact name for
each experiment on their respective pages in the sidebar. If the variable is set
`=1` then it will be enabled. Some experiments may have multiple proposals, in
which case, you will need to set the variable equal to the number of the
proposal that you want to enable (`=2`, `=3` etc).
There are three main ways to set the environment variables for an experiment.
Which method you use depends on how you intend to use the experiment:
1. Prefixing your task commands with the relevant environment variable(s). For
example, `TASK_X_{FEATURE}=1 task {my-task}`. This is intended for one-off
invocations of Task to test out experimental features.
1. Adding the relevant environment variable(s) in your "dotfiles" (e.g.
`.bashrc`, `.zshrc` etc.). This will permanently enable experimental features
for your personal environment.
```shell title="~/.bashrc"
export TASK_X_FEATURE=1
```
1. Creating a `.env` file in the same directory as your root Taskfile that
contains the relevant environment variable(s). This allows you to enable an
experimental feature at a project level. If you commit the `.env` file to
source control then other users of your project will also have these
experiments enabled.
```shell title=".env"
TASK_X_FEATURE=1
```
## Workflow
Experiments are a way for us to test out new features in Task before committing
to them in a major release. Because this concept is built around the idea of
feedback from our community, we have built a workflow for the process of
introducing these changes. This ensures that experiments are given the attention
and time that they need and that we are getting the best possible results out of
them.
The sections below describe the various stages that an experiment must go
through from its proposal all the way to being released in a major version of
Task.
### 1. Proposal
All experimental features start with a proposal in the form of a GitHub issue.
If the maintainers decide that an issue has enough support and is a breaking
change or is complex/controversial enough to require user feedback, then the
issue will be marked with the `experiment: proposal` label. At this point, the
issue becomes a proposal and a period of consultation begins. During this
period, we request that users provide feedback on the proposal and how it might
effect their use of Task. It is up to the discretion of the maintainers to
decide how long this period lasts.
### 2. Draft
Once a proposal's consultation ends, a contributor may pick up the work and
begin the initial implementation. Once a PR is opened, the maintainers will
ensure that it meets the requirements for an experimental feature (i.e. flags
are in the right format etc) and merge the feature. Once this code is released,
the status will be updated via the `experiment: draft` label. This indicates
that an implementation is now available for use in a release and the experiment
is open for feedback.
:::note
During the draft period, major changes to the implementation may be made based
on the feedback received from users. There are _no stability guarantees_ and
experimental features may be abandoned _at any time_.
:::
### 3. Candidate
Once an acceptable level of consensus has been reached by the community and
feedback/changes are less frequent/significant, the status may be updated via
the `experiment: candidate` label. This indicates that a proposal is _likely_ to
accepted and will enter a period for final comments and minor changes.
### 4. Stable
Once a suitable amount of time has passed with no changes or feedback, an
experiment will be given the `experiment: stable` label. At this point, the
functionality will be treated like any other feature in Task and any changes
_must_ be backward compatible. This allows users to migrate to the new
functionality without having to worry about anything breaking in future
releases. This provides the best experience for users migrating to a new major
version.
### 5. Released
When making a new major release of Task, all experiments marked as
`experiment: stable` will move to `experiment: released` and their behaviors
will become the new default in Task. Experiments in an earlier stage (i.e. not
stable) cannot be released and so will continue to be experiments in the new
version.
### Abandoned / Superseded
If an experiment is unsuccessful at any point then it will be given the
`experiment: abandoned` or `experiment: superseded` labels depending on which is
more suitable. These experiments will be removed from Task.

View File

@@ -0,0 +1,49 @@
---
slug: /experiments/gentle-force/
---
# Gentle Force (#1200)
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
:::warning
This experiment breaks the following functionality:
- The `--force` flag
:::
:::info
To enable this experiment, set the environment variable: `TASK_X_FORCE=1`. Check
out [our guide to enabling experiments ][enabling-experiments] for more
information.
:::
The `--force` flag currently forces _all_ tasks to run regardless of the status
checks. This can be useful, but we have found that most of the time users only
expect the direct task they are calling to be forced and _not_ all of its
dependant tasks.
This experiment changes the `--force` flag to only force the directly called
task. All dependant tasks will have their statuses checked as normal and will
only run if Task considers them to be out of date. A new `--force-all` flag will
also be added to maintain the current behavior for users that need this
functionality.
If you want to migrate, but continue to force all dependant tasks to run, you
should replace all uses of the `--force` flag with `--force-all`. Alternatively,
if you want to adopt the new behavior, you can continue to use the `--force`
flag as you do now!
<!-- prettier-ignore-start -->
[enabling-experiments]: /experiments/#enabling-experiments
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,105 @@
---
slug: /experiments/remote-taskfiles/
---
# Remote Taskfiles (#1317)
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
:::info
To enable this experiment, set the environment variable:
`TASK_X_REMOTE_TASKFILES=1`. Check out [our guide to enabling experiments
][enabling-experiments] for more information.
:::
This experiment allows you to specify a remote Taskfile URL when including a
Taskfile. For example:
```yaml
version: '3'
includes:
my-remote-namespace: https://raw.githubusercontent.com/my-org/my-repo/main/Taskfile.yml
```
This works exactly the same way that including a local file does. Any tasks in
the remote Taskfile will be available to run from your main Taskfile via the
namespace `my-remote-namespace`. For example, if the remote file contains the
following:
```yaml
version: '3'
tasks:
hello:
silent: true
cmds:
- echo "Hello from the remote Taskfile!"
```
and you run `task my-remote-namespace:hello`, it will print the text: "Hello
from the remote Taskfile!" to your console.
## Security
Running commands from sources that you do not control is always a potential
security risk. For this reason, we have added some checks when using remote
Taskfiles:
1. When running a task from a remote Taskfile for the first time, Task will
print a warning to the console asking you to check that you are sure that you
trust the source of the Taskfile. If you do not accept the prompt, then Task
will exit with code `104` (not trusted) and nothing will run. If you accept
the prompt, the remote Taskfile will run and further calls to the remote
Taskfile will not prompt you again.
2. Whenever you run a remote Taskfile, Task will create and store a checksum of
the file that you are running. If the checksum changes, then Task will print
another warning to the console to inform you that the contents of the remote
file has changed. If you do not accept the prompt, then Task will exit with
code `104` (not trusted) and nothing will run. If you accept the prompt, the
checksum will be updated and the remote Taskfile will run.
Sometimes you need to run Task in an environment that does not have an
interactive terminal, so you are not able to accept a prompt. In these cases you
are able to tell task to accept these prompts automatically by using the `--yes`
flag. Before enabling this flag, you should:
1. Be sure that you trust the source and contents of the remote Taskfile.
2. Consider using a pinned version of the remote Taskfile (e.g. A link
containing a commit hash) to prevent Task from automatically accepting a
prompt that says a remote Taskfile has changed.
Task currently supports both `http` and `https` URLs. However, the `http`
requests will not execute by default unless you run the task with the
`--insecure` flag. This is to protect you from accidentally running a remote
Taskfile that is hosted on and unencrypted connection. Sources that are not
protected by TLS are vulnerable to [man-in-the-middle
attacks][man-in-the-middle-attacks] and should be avoided unless you know what
you are doing.
## Caching & Running Offline
Whenever you run a remote Taskfile, the latest copy will be downloaded from the
internet and cached locally. If for whatever reason, you lose access to the
internet, you will still be able to run your tasks by specifying the `--offline`
flag. This will tell Task to use the latest cached version of the file instead
of trying to download it. You are able to use the `--download` flag to update
the cached version of the remote files without running any tasks.
By default, Task will timeout requests to download remote files after 10 seconds
and look for a cached copy instead. This timeout can be configured by setting
the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will
set the timeout to 5 seconds.
<!-- prettier-ignore-start -->
[enabling-experiments]: /experiments/#enabling-experiments
[man-in-the-middle-attacks]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,42 @@
---
# This is a template for an experiments documentation
# Copy this page and fill in the details as necessary
title: '--- Template ---'
sidebar_position: -1 # Always push to the top
draft: true # Hide in production
---
# \{Name of Experiment\} (#\{Issue\})
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
:::warning
This experiment breaks the following functionality:
- \{list any existing functionality that will be broken by this experiment\}
- \{if there are no breaking changes, remove this admonition\}
:::
:::info
To enable this experiment, set the environment variable: `TASK_X_{feature}=1`.
Check out [our guide to enabling experiments ][enabling-experiments] for more
information.
:::
\{Short description of the feature\}
\{Short explanation of how users should migrate to the new behavior\}
<!-- prettier-ignore-start -->
[enabling-experiments]: /experiments/#enabling-experiments
<!-- prettier-ignore-end -->

101
docs/docs/faq.md Normal file
View File

@@ -0,0 +1,101 @@
---
slug: /faq/
sidebar_position: 15
---
# FAQ
This page contains a list of frequently asked questions about Task.
## Why won't my task update my shell environment?
This is a limitation of how shells work. Task runs as a subprocess of your
current shell, so it can't change the environment of the shell that started it.
This limitation is shared by other task runners and build tools too.
A common way to work around this is to create a task that will generate output
that can be parsed by your shell. For example, to set an environment variable on
your shell you can write a task like this:
```yaml
my-shell-env:
cmds:
- echo "export FOO=foo"
- echo "export BAR=bar"
```
Now run `eval $(task my-shell-env)` and the variables `$FOO` and `$BAR` will be
available in your shell.
## I can't reuse my shell in a task's commands
Task runs each command as a separate shell process, so something you do in one
command won't effect any future commands. For example, this won't work:
```yaml
version: '3'
tasks:
foo:
cmds:
- a=foo
- echo $a
# outputs ""
```
To work around this you can either use a multiline command:
```yaml
version: '3'
tasks:
foo:
cmds:
- |
a=foo
echo $a
# outputs "foo"
```
Or for more complex multi-line commands it is recommended to move your code into
a separate file and call that instead:
```yaml
version: '3'
tasks:
foo:
cmds:
- ./foo-printer.bash
```
```bash
#!/bin/bash
a=foo
echo $a
```
## 'x' builtin command doesn't work on Windows
The default shell on Windows (`cmd` and `powershell`) do not have commands like
`rm` and `cp` available as builtins. This means that these commands won't work.
If you want to make your Taskfile fully cross-platform, you'll need to work
around this limitation using one of the following methods:
- Use the `{{OS}}` function to run an OS-specific script.
- Use something like `{{if eq OS "windows"}}powershell {{end}}<my_cmd>` to
detect windows and run the command in Powershell directly.
- Use a shell on Windows that supports these commands as builtins, such as [Git
Bash][git-bash] or [WSL][wsl].
We want to make improvements to this part of Task and the issues below track
this work. Constructive comments and contributions are very welcome!
- #197
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)
<!-- prettier-ignore-start -->
[git-bash]: https://gitforwindows.org/
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/install
<!-- prettier-ignore-end -->

View File

@@ -18,11 +18,38 @@ Task is as simple as running:
brew install go-task/tap/go-task
```
The above Formula is
[maintained by ourselves](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb).
Recently, Task was also made available
[on the official Homebrew repository](https://formulae.brew.sh/formula/go-task),
so you also have that option if you prefer:
```bash
brew install go-task
```
### Tea
If you're on macOS or Linux and have [tea][tea] installed, getting
Task is as simple as running:
```bash
tea task
```
or, if you have teas magic enabled:
```bash
task
```
This installation method is community owned. After a new release of Task, they
are automatically released by tea in a minimum of time.
### Snap
Task is available in [Snapcraft][snapcraft], but keep in mind that your
Linux distribution should allow classic confinement for Snaps to Task work
right:
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux
distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
@@ -30,8 +57,8 @@ sudo snap install task --classic
### Chocolatey
If you're on Windows and have [Chocolatey][choco] installed, getting
Task is as simple as running:
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as
simple as running:
```bash
choco install go-task
@@ -41,15 +68,15 @@ This installation method is community owned.
### Scoop
If you're on Windows and have [Scoop][scoop] installed, getting
Task is as simple as running:
If you're on Windows and have [Scoop][scoop] installed, getting Task is as
simple as running:
```cmd
scoop install task
```
This installation method is community owned. After a new release of Task, it
may take some time until it's available on Scoop.
This installation method is community owned. After a new release of Task, it may
take some time until it's available on Scoop.
### AUR
@@ -75,26 +102,29 @@ This installation method is community owned.
### Fedora
If you're on Fedora Linux you can install Task from the official
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/) repository using `dnf`:
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
repository using `dnf`:
```cmd
sudo dnf install go-task
```
This installation method is community owned. After a new release of Task, it
may take some time until it's available in [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
This installation method is community owned. After a new release of Task, it may
take some time until it's available in
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
### Nix
If you're on NixOS or have Nix installed
you can install Task from [nixpkgs](https://github.com/NixOS/nixpkgs):
If you're on NixOS or have Nix installed you can install Task from
[nixpkgs](https://github.com/NixOS/nixpkgs):
```cmd
nix-env -iA nixpkgs.go-task
```
This installation method is community owned. After a new release of Task, it
may take some time until it's available in [nixpkgs](https://github.com/NixOS/nixpkgs).
This installation method is community owned. After a new release of Task, it may
take some time until it's available in
[nixpkgs](https://github.com/NixOS/nixpkgs).
### npm
@@ -105,12 +135,22 @@ You can also use Node and npm to install Task by installing
npm install -g @go-task/cli
```
### Winget
If you are using Windows and installed the
[winget](https://github.com/microsoft/winget-cli) package management tool, you
can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
```bash
winget install Task.Task
```
## Get The Binary
### Binary
You can download the binary from the [releases page on GitHub][releases] and
add to your `$PATH`.
You can download the binary from the [releases page on GitHub][releases] and add
to your `$PATH`.
DEB and RPM packages are also available.
@@ -147,12 +187,14 @@ default.
### GitHub Actions
If you want to install Task in GitHub Actions you can try using
[this action](https://github.com/arduino/setup-task)
by the Arduino team:
[this action](https://github.com/arduino/setup-task) by the Arduino team:
```yaml
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
This installation method is community owned.
@@ -161,9 +203,11 @@ This installation method is community owned.
### Go Modules
First, make sure you have [Go][go] properly installed and setup.
Ensure that you have a supported version of [Go][go] properly installed and
setup. You can find the minimum required version of Go in the
[go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
You can easily install the latest release globally by running:
You can then install the latest release globally by running:
```bash
go install github.com/go-task/task/v3/cmd/task@latest
@@ -175,15 +219,9 @@ Or you can install into another directory:
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
```
If using Go 1.15 or earlier, instead use:
```bash
env GO111MODULE=on go get -u github.com/go-task/task/v3/cmd/task@latest
```
:::tip
For CI environments we recommend using the [install script](#get-the-binary)
For CI environments we recommend using the [install script](#install-script)
instead, which is faster and more stable, since it'll just download the latest
released binary.
@@ -193,7 +231,7 @@ released binary.
Download the autocompletion file corresponding to your shell.
[All completions are available on the Task repository](https://github.com/go-task/task/tree/master/completion).
[All completions are available on the Task repository](https://github.com/go-task/task/tree/main/completion).
### Bash
@@ -251,11 +289,14 @@ Add the line and save the file:
Invoke-Expression -Command path/to/task.ps1
```
<!-- prettier-ignore-start -->
[go]: https://golang.org/
[snapcraft]: https://snapcraft.io/task
[homebrew]: https://brew.sh/
[installscript]: https://github.com/go-task/task/blob/master/install-task.sh
[installscript]: https://github.com/go-task/task/blob/main/install-task.sh
[releases]: https://github.com/go-task/task/releases
[godownloader]: https://github.com/goreleaser/godownloader
[choco]: https://chocolatey.org/
[scoop]: https://scoop.sh/
[tea]: https://tea.xyz/
<!-- prettier-ignore-end -->

84
docs/docs/integrations.md Normal file
View File

@@ -0,0 +1,84 @@
---
slug: /integrations/
sidebar_position: 8
---
# Integrations
## Visual Studio Code Extension
Task has an
[official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task).
The code for this project can be found
[here](https://github.com/go-task/vscode-task). To use this extension, you must
have Task v3.23.0+ installed on your system.
This extension provides the following features (and more):
- View tasks in the sidebar.
- Run tasks from the sidebar and command palette.
- Go to definition from the sidebar and command palette.
- Run last task command.
- Multi-root workspace support.
- Initialize a Taskfile in the current workspace.
To get autocompletion and validation for your Taskfile, see the
[Schema](#schema) section below.
![Task for Visual Studio Code](https://github.com/go-task/vscode-task/blob/main/res/preview.png?raw=true)
## Schema
This was initially created by @KROSF in
[this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895) and
is now officially maintained in
[this file](https://github.com/go-task/task/blob/main/docs/static/schema.json)
and made available at https://taskfile.dev/schema.json. This schema can be used
to validate Taskfiles and provide autocompletion in many code editors:
### Visual Studio Code
To integrate the schema into VS Code, you need to install the
[YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
by Red Hat. Any `Taskfile.yml` in your project should automatically be detected
and validation/autocompletion should work. If this doesn't work or you want to
manually configure it for files with a different name, you can add the following
to your `settings.json`:
```json
// settings.json
{
"yaml.schemas": {
"https://taskfile.dev/schema.json": [
"**/Taskfile.yml",
"./path/to/any/other/taskfile.yml"
]
}
}
```
You can also configure the schema directly inside of a Taskfile by adding the
following comment to the top of the file:
```yaml
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
```
You can find more information on this in the
[YAML language server project](https://github.com/redhat-developer/yaml-language-server).
## Community Integrations
In addition to our official integrations, there is an amazing community of
developers who have created their own integrations for Task:
- [Sublime Text Plugin](https://packagecontrol.io/packages/Taskfile)
[[source](https://github.com/biozz/sublime-taskfile)] by @biozz
- [IntelliJ Plugin](https://plugins.jetbrains.com/plugin/17058-taskfile)
[[source](https://github.com/lechuckroh/task-intellij-plugin)] by @lechuckroh
- [mk](https://github.com/pycontribs/mk) command line tool recognizes Taskfiles
natively.
If you have made something that integrates with Task, please feel free to open a
PR to add it to this list.

View File

@@ -17,7 +17,7 @@ Since it's written in [Go][go], Task is just a single binary and has no other
dependencies, which means you don't need to mess with any complicated install
setups just to use a build tool.
Once [installed](installation.md), you just need to describe your build tasks
Once [installed](/installation), you just need to describe your build tasks
using a simple [YAML][yaml] schema in a file called `Taskfile.yml`:
```yaml title="Taskfile.yml"
@@ -37,27 +37,20 @@ guide to check the full schema documentation and Task features.
## Features
- [Easy installation](installation.md): just download a single binary, add to
- [Easy installation](/installation): just download a single binary, add to
`$PATH` and you're done! Or you can also install using [Homebrew][homebrew],
[Snapcraft][snapcraft], or [Scoop][scoop] if you want.
- Available on CIs: by adding [this simple command](installation.md#install-script)
to install on your CI script and you're ready to use Task as part of your CI pipeline;
- Available on CIs: by adding
[this simple command](/installation#install-script) to install on your CI
script and you're ready to use Task as part of your CI pipeline;
- Truly cross-platform: while most build tools only work well on Linux or macOS,
Task also supports Windows thanks to [this shell interpreter for Go][sh].
- Great for code generation: you can easily [prevent a task from running](/usage#prevent-unnecessary-work)
if a given set of files haven't changed since last run (based either on its
timestamp or content).
## Gold Sponsors
<div class="gold-sponsors">
| [Appwrite][appwrite] |
| - |
| [![Appwrite](/img/appwrite.svg)][appwrite] |
</div>
- Great for code generation: you can easily
[prevent a task from running](/usage#prevent-unnecessary-work) if a given set
of files haven't changed since last run (based either on its timestamp or
content).
<!-- prettier-ignore-start -->
[make]: https://www.gnu.org/software/make/
[go]: https://go.dev/
[yaml]: http://yaml.org/
@@ -65,4 +58,4 @@ guide to check the full schema documentation and Task features.
[snapcraft]: https://snapcraft.io/
[scoop]: https://scoop.sh/
[sh]: https://github.com/mvdan/sh
[appwrite]: https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund
<!-- prettier-ignore-end -->

View File

@@ -1,17 +1,17 @@
---
slug: /releasing/
sidebar_position: 8
sidebar_position: 13
---
# Releasing
The release process of Task is done with the help of
[GoReleaser][goreleaser]. You can test the release process locally by calling
the `test-release` task of the Taskfile.
The release process of Task is done with the help of [GoReleaser][goreleaser].
You can test the release process locally by calling the `test-release` task of
the Taskfile.
[GitHub Actions](https://github.com/go-task/task/actions) should release
artifacts automatically when a new Git tag is pushed to master
(raw executables and DEB and RPM packages).
artifacts automatically when a new Git tag is pushed to `main` branch (raw
executables and DEB and RPM packages).
Since v3.15.0, raw executables can also be reproduced and verified locally by
checking out a specific tag and calling `goreleaser build`, using the Go version
@@ -33,28 +33,40 @@ and then run `task npm:publish` to push it.
The [snap package][snappackage] requires to manual steps to release a new
version:
* Updating the current version on [snapcraft.yaml][snapcraftyaml].
* Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on
the [Snapcraft dashboard][snapcraftdashboard].
- Updating the current version on [snapcraft.yaml][snapcraftyaml].
- Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel
on the [Snapcraft dashboard][snapcraftdashboard].
# winget
winget also requires manual steps to be completed. By running
`task goreleaser:test` locally, manifest files will be generated on
`dist/winget/manifests/t/Task/Task/v{version}`.
[Upload the manifest directory into this fork](https://github.com/go-task/winget-pkgs/tree/master/manifests/t/Task/Task)
and open a pull request into
[this repository](https://github.com/microsoft/winget-pkgs).
# Scoop
Scoop is a command-line package manager for the Windows operating system.
Scoop package manifests are maintained by the community.
Scoop owners usually take care of updating versions there by editing [this file](https://github.com/lukesampson/scoop-extras/blob/master/bucket/task.json).
Scoop is a command-line package manager for the Windows operating system. Scoop
package manifests are maintained by the community. Scoop owners usually take
care of updating versions there by editing
[this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json).
If you think its Task version is outdated, open an issue to let us know.
# Nix
Nix is a community owned installation method. Nix package maintainers usually take care
of updating versions there by editing
Nix is a community owned installation method. Nix package maintainers usually
take care of updating versions there by editing
[this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/go-task/default.nix).
If you think its Task version is outdated, open an issue to let us know.
<!-- prettier-ignore-start -->
[goreleaser]: https://goreleaser.com/
[homebrewtap]: https://github.com/go-task/homebrew-tap
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb
[packagejson]: https://github.com/go-task/task/blob/master/package.json#L3
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
[snappackage]: https://github.com/go-task/snap
[snapcraftyaml]: https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2
[snapcraftyaml]: https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
[snapcraftdashboard]: https://snapcraft.io/task/releases
<!-- prettier-ignore-end -->

View File

@@ -1,6 +1,6 @@
---
slug: /styleguide/
sidebar_position: 5
sidebar_position: 10
---
# Styleguide
@@ -14,21 +14,6 @@ followed. Feel free to disagree and proceed differently at some point if you
need or want to. Also, feel free to open issues or pull requests with
improvements to this guide.
## Use `Taskfile.yml` and not `taskfile.yml`
```yaml
# bad
taskfile.yml
# good
Taskfile.yml
```
This is important especially for Linux users. Windows and macOS have case
insensitive filesystems, so `taskfile.yml` will end up working, even that not
officially supported. On Linux, only `Taskfile.yml` will work, though.
## Use the correct order of keywords
- `version:`
@@ -214,3 +199,27 @@ tasks:
```
This is also done automatically when using included Taskfiles.
## Prefer external scripts over complex multi-line commands
```yaml
# bad
version: '3'
tasks:
build:
cmds:
- |
for i in $(seq 1 10); do
echo $i
echo "some other complex logic"
done'
# good
version: '3'
tasks:
build:
cmds:
- ./scripts/my_complex_script.sh
```

View File

@@ -1,6 +1,6 @@
---
slug: /taskfile-versions/
sidebar_position: 9
sidebar_position: 5
---
# Taskfile Versions
@@ -18,169 +18,18 @@ The `version:` key on Taskfile accepts a semver string, so either `2`, `2.0` or
`2.1` features, but if you choose to use `2`, then any `2.x.x` features will be
available, but not `3.0.0+`.
## Version 1
> NOTE: Taskfiles in version 1 are not supported on Task >= v3.0.0 anymore.
In the first version of the `Taskfile`, the `version:` key was not available,
because the tasks was in the root of the YAML document. Like this:
```yaml
echo:
cmds:
- echo "Hello, World!"
```
The variable priority order was also different:
1. Call variables
2. Environment
3. Task variables
4. `Taskvars.yml` variables
## Version 2.0
At version 2, we introduced the `version:` key, to allow us to evolve Task
with new features without breaking existing Taskfiles. The new syntax is as
follows:
```yaml
version: '2'
tasks:
echo:
cmds:
- echo "Hello, World!"
```
Version 2 allows you to write global variables directly in the Taskfile,
if you don't want to create a `Taskvars.yml`:
```yaml
version: '2'
vars:
GREETING: Hello, World!
tasks:
greet:
cmds:
- echo "{{.GREETING}}"
```
The variable priority order changed to the following:
1. Task variables
2. Call variables
3. Taskfile variables
4. Taskvars file variables
5. Environment variables
A new global option was added to configure the number of variables expansions
(which default to 2):
```yaml
version: '2'
expansions: 3
vars:
FOO: foo
BAR: bar
BAZ: baz
FOOBAR: "{{.FOO}}{{.BAR}}"
FOOBARBAZ: "{{.FOOBAR}}{{.BAZ}}"
tasks:
default:
cmds:
- echo "{{.FOOBARBAZ}}"
```
## Version 2.1
Version 2.1 includes a global `output` option, to allow having more control
over how commands output are printed to the console
(see [documentation][output] for more info):
```yaml
version: '2'
output: prefixed
tasks:
server:
cmds:
- go run main.go
prefix: server
```
From this version it's also possible to ignore errors of a command or task
(check documentation [here][ignore_errors]):
```yaml
version: '2'
tasks:
example-1:
cmds:
- cmd: exit 1
ignore_error: true
- echo "This will be print"
example-2:
cmds:
- exit 1
- echo "This will be print"
ignore_error: true
```
## Version 2.2
Version 2.2 comes with a global `includes` options to include other
Taskfiles:
```yaml
version: '2'
includes:
docs: ./documentation # will look for ./documentation/Taskfile.yml
docker: ./DockerTasks.yml
```
## Version 2.6
Version 2.6 comes with `preconditions` stanza in tasks.
```yaml
version: '2'
tasks:
upload_environment:
preconditions:
- test -f .env
cmds:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation][includes]
[output]: usage.md#output-syntax
[ignore_errors]: usage.md#ignore-errors
[includes]: usage.md#including-other-taskfiles
## Version 3
## Version 3 ![latest](https://img.shields.io/badge/latest-brightgreen)
These are some major changes done on `v3`:
- Task's output will now be colored
- Added support for `.env` like files
- Added `label:` setting to task so one can override how the task name
appear in the logs
- A global `method:` was added to allow setting the default method,
and Task's default changed to `checksum`
- Added `label:` setting to task so one can override how the task name appear in
the logs
- A global `method:` was added to allow setting the default method, and Task's
default changed to `checksum`
- Two magic variables were added when using `status:`: `CHECKSUM` and
`TIMESTAMP` which contains, respectively, the md5 checksum and greatest
`TIMESTAMP` which contains, respectively, the XXH3 checksum and greatest
modification timestamp of the files listed on `sources:`
- Also, the `TASK` variable is always available with the current task name
- CLI variables are always treated as global variables
@@ -220,11 +69,195 @@ tasks:
print: echo "Hello, World!"
```
- There was a major refactor on how variables are handled. They're now easier
to understand. The `expansions:` setting was removed as it became unncessary.
This is the order in which Task will process variables, each level can see
the variables set by the previous one and override those.
- There was a major refactor on how variables are handled. They're now easier to
understand. The `expansions:` setting was removed as it became unnecessary.
This is the order in which Task will process variables, each level can see the
variables set by the previous one and override those.
- Environment variables
- Global + CLI variables
- Call variables
- Task variables
## Version 2.6
:::caution
v2 schemas are [no longer supported by the latest version of
Task][deprecate-version-2-schema].
:::
Version 2.6 comes with `preconditions` stanza in tasks.
```yaml
version: '2'
tasks:
upload_environment:
preconditions:
- test -f .env
cmds:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation][includes]
## Version 2.2
:::caution
v2 schemas are [no longer supported by the latest version of
Task][deprecate-version-2-schema].
:::
Version 2.2 comes with a global `includes` options to include other Taskfiles:
```yaml
version: '2'
includes:
docs: ./documentation # will look for ./documentation/Taskfile.yml
docker: ./DockerTasks.yml
```
## Version 2.1
:::caution
v2 schemas are [no longer supported by the latest version of
Task][deprecate-version-2-schema].
:::
Version 2.1 includes a global `output` option, to allow having more control over
how commands output are printed to the console (see [documentation][output] for
more info):
```yaml
version: '2'
output: prefixed
tasks:
server:
cmds:
- go run main.go
prefix: server
```
From this version it's also possible to ignore errors of a command or task
(check documentation [here][ignore_errors]):
```yaml
version: '2'
tasks:
example-1:
cmds:
- cmd: exit 1
ignore_error: true
- echo "This will be print"
example-2:
cmds:
- exit 1
- echo "This will be print"
ignore_error: true
```
## Version 2.0
:::caution
v2 schemas are [no longer supported by the latest version of
Task][deprecate-version-2-schema].
:::
At version 2, we introduced the `version:` key, to allow us to evolve Task with
new features without breaking existing Taskfiles. The new syntax is as follows:
```yaml
version: '2'
tasks:
echo:
cmds:
- echo "Hello, World!"
```
Version 2 allows you to write global variables directly in the Taskfile, if you
don't want to create a `Taskvars.yml`:
```yaml
version: '2'
vars:
GREETING: Hello, World!
tasks:
greet:
cmds:
- echo "{{.GREETING}}"
```
The variable priority order changed to the following:
1. Task variables
2. Call variables
3. Taskfile variables
4. Taskvars file variables
5. Environment variables
A new global option was added to configure the number of variables expansions
(which default to 2):
```yaml
version: '2'
expansions: 3
vars:
FOO: foo
BAR: bar
BAZ: baz
FOOBAR: '{{.FOO}}{{.BAR}}'
FOOBARBAZ: '{{.FOOBAR}}{{.BAZ}}'
tasks:
default:
cmds:
- echo "{{.FOOBARBAZ}}"
```
## Version 1
:::caution
v1 schema support was removed in Task >= v3.0.0.
:::
In the first version of the `Taskfile`, the `version:` key was not available,
because the tasks was in the root of the YAML document. Like this:
```yaml
echo:
cmds:
- echo "Hello, World!"
```
The variable priority order was also different:
1. Call variables
2. Environment
3. Task variables
4. `Taskvars.yml` variables
<!-- prettier-ignore-start -->
[deprecate-version-2-schema]: /deprecations/version-2-schema/
[output]: /usage#output-syntax
[ignore_errors]: /usage#ignore-errors
[includes]: /usage#including-other-taskfiles
<!-- prettier-ignore-end -->

22
docs/docs/translate.md Normal file
View File

@@ -0,0 +1,22 @@
---
slug: /translate/
sidebar_position: 12
---
# Translate
Want to help us translate this documentation? In this document we explain how.
Do NOT edit translated markdown files directly on the GitHub repository! We use
[Crowdin][crowdin] to allow contributors on work on translations. The repository
is periodically updated with progress from Crowdin.
If you want to have access to the Crowdin project to be able to suggest
translations, please ask for access on the [#translations channel on our Discord
server][discord]. If a given language is not being shown to Crowdin yet, just
ask and we can configure it.
<!-- prettier-ignore-start -->
[crowdin]: https://crowdin.com/project/taskfile
[discord]: https://discord.gg/6TY36E39UK
<!-- prettier-ignore-end -->

File diff suppressed because it is too large Load Diff

View File

@@ -1,190 +0,0 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const {
GITHUB_URL,
TWITTER_URL,
DISCORD_URL,
CHINESE_URL
} = require('./constants');
const lightCodeTheme = require('./src/themes/prismLight');
const darkCodeTheme = require('./src/themes/prismDark');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Task',
tagline: 'A task runner / simpler Make alternative written in Go ',
url: 'https://taskfile.dev',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'go-task',
projectName: 'task',
deploymentBranch: 'gh-pages',
i18n: {
defaultLocale: 'en',
locales: ['en']
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js')
},
blog: false,
theme: {
customCss: [
require.resolve('./src/css/custom.css'),
require.resolve('./src/css/carbon.css')
]
},
gtag: {
trackingID: 'G-4RT25NXQ7N',
anonymizeIP: true
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**']
}
})
]
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
metadata: [
{
name: 'og:image',
content: 'https://taskfile.dev/img/og-image.png'
}
],
navbar: {
title: 'Task',
logo: {
alt: 'Task Logo',
src: 'img/logo.svg'
},
items: [
{
type: 'doc',
docId: 'installation',
position: 'left',
label: 'Installation'
},
{
type: 'doc',
docId: 'usage',
position: 'left',
label: 'Usage'
},
{
type: 'doc',
docId: 'api_reference',
position: 'left',
label: 'API'
},
{
type: 'doc',
docId: 'donate',
position: 'left',
label: 'Donate'
},
{
href: GITHUB_URL,
label: 'GitHub',
position: 'right'
},
{
href: TWITTER_URL,
label: 'Twitter',
position: 'right'
},
{
href: DISCORD_URL,
label: 'Discord',
position: 'right'
}
]
},
footer: {
style: 'dark',
links: [
{
title: 'Pages',
items: [
{
label: 'Installation',
to: '/installation/'
},
{
label: 'Usage',
to: '/usage/'
},
{
label: 'Donate',
to: '/donate/'
}
]
},
{
title: 'Community',
items: [
{
label: 'GitHub',
href: GITHUB_URL
},
{
label: 'Twitter',
href: TWITTER_URL
},
{
label: 'Discord',
href: DISCORD_URL
},
{
label: 'OpenCollective',
href: 'https://opencollective.com/task'
}
]
},
{
title: 'Translations',
items: [
{
label: 'Chinese | 中国人',
href: CHINESE_URL
}
]
}
]
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme
},
// NOTE(@andreynering): Don't worry, these keys are meant to be public =)
algolia: {
appId: '7IZIJ13AI7',
apiKey: '34b64ae4fc8d9da43d9a13d9710aaddc',
indexName: 'taskfile'
}
}),
scripts: [
{
src: '/js/carbon.js',
async: true
}
]
};
module.exports = config;

268
docs/docusaurus.config.ts Normal file
View File

@@ -0,0 +1,268 @@
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import { EnumChangefreq } from 'sitemap';
import remarkGithub from 'remark-github';
import remarkGfm from 'remark-gfm';
import { DISCORD_URL } from './constants';
import { GITHUB_URL } from './constants';
import { MASTODON_URL } from './constants';
import { TWITTER_URL } from './constants';
import lightCodeTheme from './src/themes/prismLight';
import darkCodeTheme from './src/themes/prismDark';
import { getTranslationProgress } from './src/api/crowdin.js';
const translationProgress = getTranslationProgress();
const config: Config = {
title: 'Task',
tagline: 'A task runner / simpler Make alternative written in Go ',
url: 'https://taskfile.dev',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'go-task',
projectName: 'task',
deploymentBranch: 'gh-pages',
i18n: {
defaultLocale: 'en',
locales: [
'en',
'es-ES',
'fr-FR',
'ja-JP',
'pt-BR',
'ru-RU',
'tr-TR',
'zh-Hans'
],
localeConfigs: {
en: {
label: 'English',
direction: 'ltr',
htmlLang: 'en-US'
},
'es-ES': {
label: `Español (${translationProgress['es-ES'] || 0}%)`,
direction: 'ltr',
htmlLang: 'es-ES'
},
'fr-FR': {
label: `Français (${translationProgress['fr'] || 0}%)`,
direction: 'ltr',
htmlLang: 'fr-FR'
},
'ja-JP': {
label: `日本語 (${translationProgress['ja'] || 0}%)`,
direction: 'ltr',
htmlLang: 'ja-JP'
},
'pt-BR': {
label: `Português (${translationProgress['pt-BR'] || 0}%)`,
direction: 'ltr',
htmlLang: 'pt-BR'
},
'ru-RU': {
label: `Pусский (${translationProgress['ru'] || 0}%)`,
direction: 'ltr',
htmlLang: 'ru-RU'
},
'tr-TR': {
label: `Türkçe (${translationProgress['tr'] || 0}%)`,
direction: 'ltr',
htmlLang: 'tr-TR'
},
'zh-Hans': {
label: `简体中文 (${translationProgress['zh-CN'] || 0}%)`,
direction: 'ltr',
htmlLang: 'zh-Hans'
}
}
},
presets: [
[
'classic',
{
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.ts',
remarkPlugins: [remarkGithub, remarkGfm]
},
blog: {},
theme: {
customCss: [
'./src/css/custom.css',
'./src/css/carbon.css',
]
},
gtag: {
trackingID: 'G-4RT25NXQ7N',
anonymizeIP: true
},
sitemap: {
changefreq: EnumChangefreq.WEEKLY,
priority: 0.5,
ignorePatterns: ['/tags/**']
}
} satisfies Preset.Options,
]
],
scripts: [
{
src: '/js/carbon.js',
async: true
}
],
themeConfig:{
metadata: [
{
name: 'og:image',
content: 'https://taskfile.dev/img/og-image.png'
}
],
navbar: {
title: 'Task',
logo: {
alt: 'Task Logo',
src: 'img/logo.svg'
},
items: [
{
type: 'doc',
docId: 'installation',
position: 'left',
label: 'Installation'
},
{
type: 'doc',
docId: 'usage',
position: 'left',
label: 'Usage'
},
{
type: 'doc',
docId: 'api_reference',
position: 'left',
label: 'API'
},
{
to: 'blog',
label: 'Blog',
position: 'left'
},
{
type: 'doc',
docId: 'donate',
position: 'left',
label: 'Donate'
},
{
type: 'localeDropdown',
position: 'left',
dropdownItemsAfter: [
{
to: '/translate/',
label: 'Help Us Translate'
}
]
},
{
href: GITHUB_URL,
label: 'GitHub',
position: 'right'
},
{
href: TWITTER_URL,
label: 'Twitter',
position: 'right'
},
{
href: MASTODON_URL,
label: 'Mastodon',
rel: 'me',
position: 'right'
},
{
href: DISCORD_URL,
label: 'Discord',
position: 'right'
}
]
},
footer: {
style: 'dark',
links: [
{
title: 'Pages',
items: [
{
label: 'Installation',
to: '/installation/'
},
{
label: 'Usage',
to: '/usage/'
},
{
label: 'Donate',
to: '/donate/'
}
]
},
{
title: 'Community',
items: [
{
label: 'GitHub',
href: GITHUB_URL
},
{
label: 'Twitter',
href: TWITTER_URL
},
{
label: 'Mastodon',
href: MASTODON_URL,
rel: 'me'
},
{
label: 'Discord',
href: DISCORD_URL
},
{
label: 'OpenCollective',
href: 'https://opencollective.com/task'
}
]
},
{
items: [
{
html: '<a target="_blank" href="https://www.netlify.com"><img src="https://www.netlify.com/v3/img/components/netlify-color-accent.svg" alt="Deploys by Netlify" /></a>'
}
]
}
]
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme
},
// NOTE(@andreynering): Don't worry, these keys are meant to be public =)
algolia: {
appId: '7IZIJ13AI7',
apiKey: '34b64ae4fc8d9da43d9a13d9710aaddc',
indexName: 'taskfile'
}
} satisfies Preset.ThemeConfig,
};
export default config;

396
docs/i18n/en/code.json Normal file
View File

@@ -0,0 +1,396 @@
{
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page Not Found",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "We could not find what you were looking for.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "info",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Home page",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Docs pages navigation",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Edit this page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to heading",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " on {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " by {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Last updated{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Tags:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Close",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copied",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copy code to clipboard",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copy",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "On this page",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Read More",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "One min read|{readingTime} min read",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Back to main menu",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchBar.seeAll": {
"message": "See all {count} results"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "One document found|{count} documents found",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Type your search here",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Search",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Search by Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "No results were found",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Fetching new results...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "Clear the query",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "Cancel",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Recent",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "No recent searches",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Save this search",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "Remove this search from history",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "Favorite",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "Remove this search from favorites",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "Unable to fetch results",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "You might want to check your network connection.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "to select",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter key",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "to navigate",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "Arrow up",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "Arrow down",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "to close",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Escape key",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Search by",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "No results for",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "Try searching for",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "Believe this query should return results?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "Let us know.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "Search docs",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
}
}

View File

@@ -0,0 +1,6 @@
{
"version.label": {
"message": "Next",
"description": "The label for version current"
}
}

View File

@@ -0,0 +1,46 @@
{
"link.title.Pages": {
"message": "Pages",
"description": "The title of the footer links column with title=Pages in the footer"
},
"link.title.Community": {
"message": "Community",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.title.Translations": {
"message": "Translations",
"description": "The title of the footer links column with title=Translations in the footer"
},
"link.item.label.Installation": {
"message": "Installation",
"description": "The label of footer link with label=Installation linking to /installation/"
},
"link.item.label.Usage": {
"message": "Usage",
"description": "The label of footer link with label=Usage linking to /usage/"
},
"link.item.label.Donate": {
"message": "Donate",
"description": "The label of footer link with label=Donate linking to /donate/"
},
"link.item.label.GitHub": {
"message": "GitHub",
"description": "The label of footer link with label=GitHub linking to https://github.com/go-task/task"
},
"link.item.label.Twitter": {
"message": "Twitter",
"description": "The label of footer link with label=Twitter linking to https://twitter.com/taskfiledev"
},
"link.item.label.Mastodon": {
"message": "Mastodon",
"description": "The label of footer link with label=Mastodon linking to https://fosstodon.org/@task"
},
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/6TY36E39UK"
},
"link.item.label.OpenCollective": {
"message": "OpenCollective",
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
}
}

View File

@@ -0,0 +1,38 @@
{
"title": {
"message": "Task",
"description": "The title in the navbar"
},
"item.label.Installation": {
"message": "Installation",
"description": "Navbar item with label Installation"
},
"item.label.Usage": {
"message": "Usage",
"description": "Navbar item with label Usage"
},
"item.label.API": {
"message": "API",
"description": "Navbar item with label API"
},
"item.label.Donate": {
"message": "Donate",
"description": "Navbar item with label Donate"
},
"item.label.GitHub": {
"message": "GitHub",
"description": "Navbar item with label GitHub"
},
"item.label.Twitter": {
"message": "Twitter",
"description": "Navbar item with label Twitter"
},
"item.label.Mastodon": {
"message": "Mastodon",
"description": "Navbar item with label Mastodon"
},
"item.label.Discord": {
"message": "Discord",
"description": "Navbar item with label Discord"
}
}

396
docs/i18n/es-ES/code.json Normal file
View File

@@ -0,0 +1,396 @@
{
"theme.ErrorPageContent.title": {
"message": "Ha ocurrido un error con la página.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Volver a intentarlo",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Página No Encontrada",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "No pudimos encontrar lo que estabas buscando.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Por favor, contacta con el propietario del sitio al que está enlazada la URL original y comunícale que el enlace está roto.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "nota",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "pista",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "peligro",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "información",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "precaución",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Volver arriba",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archivo",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archivo",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Navegación por la página de la lista de blogs ",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Entradas más recientes",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Entradas antiguas",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Barra de paginación de publicaciones del blog",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Publicación más reciente",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Publicación más antigua",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "Una publicación|{count} publicaciones",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} etiquetados con \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "Ver Todas las Etiquetas",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Cambiar entre modo oscuro y claro (actualmente {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "modo oscuro",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "modo claro",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Página de inicio",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Navegación de páginas de documentos",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Anterior",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Siguiente",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "Un documento etiquetado|{count} documentos etiquetados",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} con \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Versión: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "Esta es documentación sin liberar para {siteTitle} {versionLabel} versión.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "Esta es documentación para {siteTitle} {versionLabel}, que ya no se mantiene activamente.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "Para la documentación actualizada, vea {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "última versión",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Editar esta página",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Enlace directo al {heading}",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " en {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " por {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Última actualización{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versiones",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Etiquetas:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Cerrar",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Navegación de publicaciones recientes",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copiado",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copiar código al portapapeles",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copiar",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "En esta página",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Leer Más",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "Lectura de un minuto|{readingTime} min de lectura",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Colapsar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Colapsar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Volver al menú principal",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchBar.seeAll": {
"message": "See all {count} results"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "Un documento encontrado|{count} documentos encontrados",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Resultados de búsqueda para \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Búsqueda en la documentación",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Escribe tu búsqueda aquí",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Buscar",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Búsqueda por Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "No se encontraron resultados",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Obteniendo nuevos resultados...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Buscar",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "Clear the query",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "Cancel",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Recent",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "No recent searches",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Save this search",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "Remove this search from history",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "Favorite",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "Remove this search from favorites",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "Unable to fetch results",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "You might want to check your network connection.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "to select",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter key",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "to navigate",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "Arrow up",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "Arrow down",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "to close",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Escape key",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Search by",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "No results for",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "Try searching for",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "Believe this query should return results?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "Let us know.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "Search docs",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.common.skipToMainContent": {
"message": "Saltar al contenido principal",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Etiquetas",
"description": "The title of the tag list page"
}
}

View File

@@ -0,0 +1,93 @@
---
title: Introducing Experiments
description: A look at where task is, where it's going and how we're going to get there.
slug: task-in-2023
authors:
- pd93
tags:
- experiments
- breaking-changes
- roadmap
- v4
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---
Lately, Task has been growing extremely quickly and I've found myself thinking a lot about the future of the project and how we continue to evolve and grow. I'm not much of a writer, but I think one of the things we could do better is to communicate these kinds of thoughts to the community. So, with that in mind, this is the first (hopefully of many) blog posts talking about Task and what we're up to.
<!--truncate-->
## :calendar: So, what have we been up to?
Over the past 12 months or so, [@andreynering][] (Author and maintainer of the project) and I ([@pd93][]) have been working in our spare time to maintain and improve v3 of Task and we've made some amazing progress. Here are just some of the things we've released in that time:
- An official [extension for VS Code][vscode-task].
- Internal Tasks ([#818](https://github.com/go-task/task/pull/818)).
- Task aliases ([#879](https://github.com/go-task/task/pull/879)).
- Looping over tasks ([#1220](https://github.com/go-task/task/pull/1200)).
- A series of refactors to the core codebase to make it more maintainable and extensible.
- Loads of bug fixes and improvements.
- An integration with [Crowdin][crowdin]. Work is in progress on making our docs available in **7 new languages** (Special thanks to all our translators for the huge help with this!).
- And much, much more! :sparkles:
We're also working on adding some really exciting and highly requested features to Task such as having the ability to run remote Taskfiles ([#1317](https://github.com/go-task/task/issues/1317)).
None of this would have been possible without the [150 or so (and growing) contributors][contributors] to the project, numerous sponsors and a passionate community of users. Together we have more than doubled the number of GitHub stars to over 8400 :star: since the beginning of 2022 and this continues to accelerate. We can't thank you all enough for your help and support! :rocket:
[![Star History Chart](https://api.star-history.com/svg?repos=go-task/task&type=Date)](https://star-history.com/#go-task/task&Date)
## What's next? :thinking:
It's extremely motivating to see so many people using and loving Task. However, in this time we've also seen an increase in the number of issues and feature requests. In particular, issues that require some kind of breaking change to Task. This isn't a bad thing, but as we grow we need to be more responsible about how we address these changes in a way that ensures stability and compatibility for existing users and their Taskfiles.
At this point you're probably thinking something like:
> "But you use [semantic versioning][semver] - Just release a new major version with your breaking changes."
And you'd be right... sort of. In theory, this sounds great, but the reality is that we don't have the time to commit to a major overhaul of Task in one big bang release. This would require a colossal amount of time and coordination and with full time jobs and personal lives to tend to, this is a difficult commitment to make. Smaller, more frequent major releases are also a significant inconvenience for users as they have to constantly keep up-to-date with our breaking changes. Fortunately, there is a better way.
## What's going to change? :monocle:
Going forwards, breaking changes will be allowed into _minor_ versions of Task as "experimental features". To access these features users will need opt-in by enabling feature flags. This will allow us to release new features slowly and gather feedback from the community before making them the default behavior in a future major release.
To prepare users for the next major release, we will maintain a list of [deprecated features][deprecations] and [experiments][experiments] on our docs website and publish information on how to migrate to the new behavior.
You can read the [full breaking change proposal][breaking-change-proposal] and view all the [current experiments and their status][experiments-project] on GitHub including the [Gentle Force][gentle-force-experiment] and [Remote Taskfiles][remote-taskfiles-experiment] experiments.
## What will happen to v2/v3 features?
v2 has been [officially deprecated][deprecate-version-2-schema]. If you're still using a Taskfile with `version: "2"` at the top we _strongly recommend_ that you upgrade as soon as possible. Removing v2 will allow us to tidy up the codebase and focus on new functionality instead.
When v4 is released, we will continue to support v3 for a period of time (bug fixes etc). However, since we are moving from a backward-compatibility model to a forwards-compatibility model, **v4 itself will not be backwards compatible with v3**.
## v4 When? :eyes:
:man_shrugging: When it's ready.
In all seriousness, we don't have a timeline for this yet. We'll be working on the most serious deficiencies of the v3 API first and regularly evaluating the state of the project. When we feel its in a good, stable place and we have a clear upgrade path for users and a number of stable experiments, we'll start to think about v4.
## :wave: Final thoughts
Task is growing fast and we're excited to see where it goes next. We hope that the steps we're taking to improve the project and our process will help us to continue to grow. As always, if you have any questions or feedback, we encourage you to comment on or open [issues][issues] and [discussions][discussions] on GitHub. Alternatively, you can join us on [Discord][discord].
I plan to write more of these blog posts in the future on a variety of Task-related topics, so make sure to check in occasionally and see what we're up to!
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[vscode-task]: https://github.com/go-task/vscode-task
[crowdin]: https://crowdin.com
[contributors]: https://github.com/go-task/task/graphs/contributors
[semver]: https://semver.org
[breaking-change-proposal]: https://github.com/go-task/task/discussions/1191
[@andreynering]: https://github.com/andreynering
[@pd93]: https://github.com/pd93
[experiments]: https://taskfile.dev/experiments
[deprecations]: https://taskfile.dev/deprecations
[deprecate-version-2-schema]: https://github.com/go-task/task/issues/1197
[issues]: https://github.com/go-task/task/issues
[discussions]: https://github.com/go-task/task/discussions
[discord]: https://discord.gg/6TY36E39UK
[experiments-project]: https://github.com/orgs/go-task/projects/1
[gentle-force-experiment]: https://github.com/go-task/task/issues/1200
[remote-taskfiles-experiment]: https://github.com/go-task/task/issues/1317

View File

@@ -0,0 +1,10 @@
andreynering:
name: Andrey Nering
title: Maintainer of Task
url: https://github.com/andreynering
image_url: https://github.com/andreynering.png
pd93:
name: Pete Davison
title: Maintainer of Task
url: https://github.com/pd93
image_url: https://github.com/pd93.png

View File

@@ -0,0 +1,6 @@
{
"version.label": {
"message": "Siguiente",
"description": "The label for version current"
}
}

View File

@@ -0,0 +1,347 @@
---
slug: /api/
sidebar_position: 4
toc_min_heading_level: 2
toc_max_heading_level: 5
---
# API Reference
## CLI
Task command line tool has the following syntax:
```bash
task [--flags] [tasks...] [-- CLI_ARGS...]
```
:::tip
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
:::
| Short | Flag | Type | Default | Description |
| ----- | --------------------------- | -------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. |
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
| | `--sort` | `string` | `default` | Changes the order of the tasks when listed.<br />`default` - Alphanumeric with root tasks first<br />`alphanumeric` - Alphanumeric<br />`none` - No sorting (As they appear in the Taskfile) |
| | `--json` | `bool` | `false` | See [JSON Output](#json-output) |
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. |
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. |
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
| | `--summary` | `bool` | `false` | Show summary about a task. |
| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | |
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
| | `--version` | `bool` | `false` | Show Task version. |
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
## Exit Codes
Task will sometimes exit with specific exit codes. These codes are split into three groups with the following ranges:
- General errors (0-99)
- Taskfile errors (100-199)
- Task errors (200-299)
A full list of the exit codes and their descriptions can be found below:
| Code | Description |
| ---- | ------------------------------------------------------------ |
| 0 | Success |
| 1 | An unknown error occurred |
| 100 | No Taskfile was found |
| 101 | A Taskfile already exists when trying to initialize one |
| 102 | The Taskfile is invalid or cannot be parsed |
| 103 | A remote Taskfile could not be downloaded |
| 104 | A remote Taskfile was not trusted by the user |
| 105 | A remote Taskfile was could not be fetched securely |
| 106 | No cache was found for a remote Taskfile in offline mode |
| 107 | No schema version was defined in the Taskfile |
| 200 | The specified task could not be found |
| 201 | An error occurred while executing a command inside of a task |
| 202 | The user tried to invoke a task that is internal |
| 203 | There a multiple tasks with the same name or alias |
| 204 | A task was called too many times |
| 205 | A task was cancelled by the user |
| 206 | A task was not executed due to missing required variables |
These codes can also be found in the repository in [`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
:::info
When Task is run with the `-x`/`--exit-code` flag, the exit code of any failed commands will be passed through to the user instead.
:::
## JSON Output
When using the `--json` flag in combination with either the `--list` or `--list-all` flags, the output will be a JSON object with the following structure:
```json
{
"tasks": [
{
"name": "",
"desc": "",
"summary": "",
"up_to_date": false,
"location": {
"line": 54,
"column": 3,
"taskfile": "/path/to/Taskfile.yml"
}
}
// ...
],
"location": "/path/to/Taskfile.yml"
}
```
## Special Variables
There are some special variables that is available on the templating system:
| Var | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
| `CLI_FORCE` | A boolean containing whether the `--force` or `--force-all` flags were set. |
| `TASK` | The name of the current task. |
| `ROOT_DIR` | The absolute path of the root Taskfile. |
| `TASKFILE_DIR` | The absolute path of the included Taskfile. |
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
| `TASK_VERSION` | The current version of task. |
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
## ENV
Some environment variables can be overridden to adjust Task behavior.
| ENV | Default | Description |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
| `TASK_COLOR_RESET` | `0` | Color used for white. |
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
| `TASK_COLOR_RED` | `31` | Color used for red. |
| `FORCE_COLOR` | | Force color output usage. |
## Taskfile Schema
| Attribute | Type | Default | Description |
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
### Include
| Attribute | Type | Default | Description |
| ---------- | --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
```yaml
includes:
foo: ./path
```
:::
### Variable
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------ |
| _itself_ | `string` | | A static value that will be set to the variable. |
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
vars:
STATIC: static
DYNAMIC:
sh: echo "dynamic"
```
:::
### Task
| Attribute | Type | Default | Description |
| --------------- | ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `prompt` | `string` | | A prompt that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
| `requires` | `[]string` | | A list of variables which should be set if this task is to run, if any of these variables are unset the task will error and not run. |
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
| `requires` | [`Requires`](#requires) | | A list of required variables which should be set if this task is to run, if any variables listed are unset the task will error and not run. |
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the task should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/main/src/go/build/syslist.go). Task will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
These alternative syntaxes are available. They will set the given values to `cmds` and everything else will be set to their default values:
```yaml
tasks:
foo: echo "foo"
foobar:
- echo "foo"
- echo "bar"
baz:
cmd: echo "baz"
```
:::
#### Command
| Attribute | Type | Default | Description |
| -------------- | ---------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmd` | `string` | | The shell command to be executed. |
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
| `for` | [`For`](#for) | | Runs the command once for each given value. |
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the command should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/main/src/go/build/syslist.go). Command will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
If given as a a string, the value will be assigned to `cmd`:
```yaml
tasks:
foo:
cmds:
- echo "foo"
- echo "bar"
```
:::
#### Dependency
| Attribute | Type | Default | Description |
| --------- | ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
:::tip
If you don't want to set additional variables, it's enough to declare the dependency as a list of strings (they will be assigned to `task`):
```yaml
tasks:
foo:
deps: [foo, bar]
```
:::
#### For
The `for` parameter can be defined as a string, a list of strings or a map. If it is defined as a string, you can give it any of the following values:
- `source` - Will run the command for each source file defined on the task. (Glob patterns will be resolved, so `*.go` will run for every Go file that matches).
If it is defined as a list of strings, the command will be run for each value.
Finally, the `for` parameter can be defined as a map when you want to use a variable to define the values to loop over:
| Attribute | Type | Default | Description |
| --------- | -------- | ---------------- | -------------------------------------------- |
| `var` | `string` | | The name of the variable to use as an input. |
| `split` | `string` | (any whitespace) | What string the variable should be split on. |
| `as` | `string` | `ITEM` | The name of the iterator variable. |
#### Precondition
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
:::tip
If you don't want to set a different message, you can declare a precondition like this and the value will be assigned to `sh`:
```yaml
tasks:
foo:
precondition: test -f Taskfile.yml
```
:::
#### Requires
| Attribute | Type | Default | Description |
| --------- | ---------- | ------- | -------------------------------------------------------------------------------------------------- |
| `vars` | `[]string` | | List of variable or environment variable names that must be set if this task is to execute and run |

View File

@@ -0,0 +1,573 @@
---
slug: /changelog/
sidebar_position: 14
---
# Changelog
## v3.33.1 - 2023-12-21
- Added support for looping over map variables with the [Any Variables experiment](https://taskfile.dev/experiments/any_variables) enabled (#1435, #1437 by @pd93).
- Fixed a bug where dynamic variables were causing errors during fast compilation (#1435, #1437 by @pd93)
## v3.33.0 - 2023-12-20
- Added [Any Variables experiment](https://taskfile.dev/experiments/any-variables) (#1415, #1421 by @pd93).
- Updated Docusaurus to v3 (#1432 by @pd93).
- Added `aliases` to `--json` flag output (#1430, #1431 by @pd93).
- Added new `CLI_FORCE` special variable containing whether the `--force` or `--force-all` flags were set (#1412, #1434 by @pd93).
## v3.32.0 - 2023-11-29
- Added ability to exclude some files from `sources:` by using `exclude:` (#225,
# 1324 by @pd93 and @andreynering).
- The [Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles) now prefers remote files over cached ones by default (#1317, #1345 by @pd93).
- Added `--timeout` flag to the [Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles) (#1317, #1345 by @pd93).
- Fix bug where dynamic `vars:` and `env:` were being executed when they should actually be skipped by `platforms:` (#1273, #1377 by @andreynering).
- Fix `schema.json` to make `silent` valid in `cmds` that use `for` (#1385,
# 1386 by @iainvm).
- Add new `--no-status` flag to skip expensive status checks when running `task --list --json` (#1348, #1368 by @amancevice).
## v3.31.0 - 2023-10-07
- Enabled the `--yes` flag for the [Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles) (#1317, #1344 by @pd93).
- Add ability to set `watch: true` in a task to automatically run it in watch mode (#231, #1361 by @andreynering).
- Fixed a bug on the watch mode where paths that contained `.git` (like `.github`), for example, were also being ignored (#1356 by @butuzov).
- Fixed a nil pointer error when running a Taskfile with no contents (#1341,
# 1342 by @pd93).
- Added a new [exit code](https://taskfile.dev/api/#exit-codes) (107) for when a Taskfile does not contain a schema version (#1342 by @pd93).
- Increased limit of maximum task calls from 100 to 1000 for now, as some people have been reaching this limit organically now that we have loops. This check exists to detect recursive calls, but will be removed in favor of a better algorithm soon (#1321, #1332).
- Fixed templating on descriptions on `task --list` (#1343 by @blackjid).
- Fixed a bug where precondition errors were incorrectly being printed when task execution was aborted (#1337, #1338 by @sylv-io).
## v3.30.1 - 2023-09-14
- Fixed a regression where some special variables weren't being set correctly (#1331, #1334 by @pd93).
## v3.30.0 - 2023-09-13
- Prep work for Remote Taskfiles (#1316 by @pd93).
- Added the [Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles) as a draft (#1152, #1317 by @pd93).
- Improve performance of content checksuming on `sources:` by replacing md5 with [XXH3](https://xxhash.com/) which is much faster. This is a soft breaking change because checksums will be invalidated when upgrading to this release (#1325 by @ReillyBrogan).
## v3.29.1 - 2023-08-26
- Update to Go 1.21 (bump minimum version to 1.20) (#1302 by @pd93)
- Fix a missing a line break on log when using `--watch` mode (#1285, #1297 by @FilipSolich).
- Fix `defer` on JSON Schema (#1288 by @calvinmclean and @andreynering).
- Fix bug in usage of special variables like `{{.USER_WORKING_DIR}}` in combination with `includes` (#1046, #1205, #1250, #1293, #1312, #1274 by @andarto, #1309 by @andreynering).
- Fix bug on `--status` flag. Running this flag should not have side-effects: it should not update the checksum on `.task`, only report its status (#1305,
# 1307 by @visciang, #1313 by @andreynering).
## v3.28.0 - 2023-07-24
- Added the ability to [loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values) using `for` (#82, #1220 by @pd93).
- Fixed variable propagation in multi-level includes (#778, #996, #1256 by @hudclark).
- Fixed a bug where the `--exit-code` code flag was not returning the correct exit code when calling commands indirectly (#1266, #1270 by @pd93).
- Fixed a `nil` panic when a dependency was commented out or left empty (#1263 by @neomantra).
## v3.27.1 - 2023-06-30
- Fix panic when a `.env` directory (not file) is present on current directory (#1244, #1245 by @pd93).
## v3.27.0 - 2023-06-29
- Allow Taskfiles starting with lowercase characters (#947, #1221 by @pd93).
- e.g. `taskfile.yml`, `taskfile.yaml`, `taskfile.dist.yml` & `taskfile.dist.yaml`
- Bug fixes were made to the [npm installation method](https://taskfile.dev/installation/#npm). (#1190, by @sounisi5011).
- Added the [gentle force experiment](https://taskfile.dev/experiments/gentle-force) as a draft (#1200, #1216 by @pd93).
- Added an `--experiments` flag to allow you to see which experiments are enabled (#1242 by @pd93).
- Added ability to specify which variables are required in a task (#1203, #1204 by @benc-uk).
## v3.26.0 - 2023-06-10
- Only rewrite checksum files in `.task` if the checksum has changed (#1185,
# 1194 by @deviantintegral).
- Added [experiments documentation](https://taskfile.dev/experiments) to the website (#1198 by @pd93).
- Deprecated `version: 2` schema. This will be removed in the next major release (#1197, #1198, #1199 by @pd93).
- Added a new `prompt:` prop to set a warning prompt to be shown before running a potential dangurous task (#100, #1163 by @MaxCheetham, [Documentation](https://taskfile.dev/usage/#warning-prompts)).
- Added support for single command task syntax. With this change, it's now possible to declare just `cmd:` in a task, avoiding the more complex `cmds: []` when you have only a single command for that task (#1130, #1131 by @timdp).
## v3.25.0 - 2023-05-22
- Support `silent:` when calling another tasks (#680, #1142 by @danquah).
- Improve PowerShell completion script (#1168 by @trim21).
- Add more languages to the website menu and show translation progress percentage (#1173 by @misitebao).
- Starting on this release, official binaries for FreeBSD will be available to download (#1068 by @andreynering).
- Fix some errors being unintendedly supressed (#1134 by @clintmod).
- Fix a nil pointer error when `version` is omitted from a Taskfile (#1148,
# 1149 by @pd93).
- Fix duplicate error message when a task does not exists (#1141, #1144 by @pd93).
## v3.24.0 - 2023-04-15
- Fix Fish shell completion for tasks with aliases (#1113 by @patricksjackson).
- The default branch was renamed from `master` to `main` (#1049, #1048 by @pd93).
- Fix bug where "up-to-date" logs were not being omitted for silent tasks (#546,
# 1107 by @danquah).
- Add `.hg` (Mercurial) to the list of ignored directories when using `--watch` (#1098 by @misery).
- More improvements to the release tool (#1096 by @pd93).
- Enforce [gofumpt](https://github.com/mvdan/gofumpt) linter (#1099 by @pd93)
- Add `--sort` flag for use with `--list` and `--list-all` (#946, #1105 by @pd93).
- Task now has [custom exit codes](https://taskfile.dev/api/#exit-codes) depending on the error (#1114 by @pd93).
## v3.23.0 - 2023-03-26
Task now has an [official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task) contributed by @pd93! :tada: The extension is maintained in a [new repository](https://github.com/go-task/vscode-task) under the `go-task` organization. We're looking to gather feedback from the community so please give it a go and let us know what you think via a [discussion](https://github.com/go-task/vscode-task/discussions), [issue](https://github.com/go-task/vscode-task/issues) or on our [Discord](https://discord.gg/6TY36E39UK)!
> **NOTE:** The extension _requires_ v3.23.0 to be installed in order to work.
- The website was integrated with [Crowdin](https://crowdin.com/project/taskfile) to allow the community to contribute with translations! [Chinese](https://taskfile.dev/zh-Hans/) is the first language available (#1057, #1058 by @misitebao).
- Added task location data to the `--json` flag output (#1056 by @pd93)
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to `Taskfile.yml` (#1062 by @misitebao).
- Added new `splitArgs` template function (`{{splitArgs "foo bar 'foo bar baz'"}}`) to ensure string is split as arguments (#1040, #1059 by @dhanusaputra).
- Fix the value of `{{.CHECKSUM}}` variable in status (#1076, #1080 by @pd93).
- Fixed deep copy implementation (#1072 by @pd93)
- Created a tool to assist with releases (#1086 by @pd93).
## v3.22.0 - 2023-03-10
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your `$HOME` directory. This is useful to have automation that you can run from anywhere in your system! ([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), #1029 by @andreynering).
- Add ability to set `error_only: true` on the `group` output mode. This will instruct Task to only print a command output if it returned with a non-zero exit code (#664, #1022 by @jaedle).
- Fixed bug where `.task/checksum` file was sometimes not being created when task also declares a `status:` (#840, #1035 by @harelwa, #1037 by @pd93).
- Refactored and decoupled fingerprinting from the main Task executor (#1039 by @pd93).
- Fixed deadlock issue when using `run: once` (#715, #1025 by @theunrepentantgeek).
## v3.21.0 - 2023-02-22
- Added new `TASK_VERSION` special variable (#990, #1014 by @ja1code).
- Fixed a bug where tasks were sometimes incorrectly marked as internal (#1007 by @pd93).
- Update to Go 1.20 (bump minimum version to 1.19) (#1010 by @pd93)
- Added environment variable `FORCE_COLOR` support to force color output. Usefull for environments without TTY (#1003 by @automation-stack)
## v3.20.0 - 2023-01-14
- Improve behavior and performance of status checking when using the `timestamp` mode (#976, #977 by @aminya).
- Performance optimizations were made for large Taskfiles (#982 by @pd93).
- Add ability to configure options for the [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) and [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) builtins (#908, #929 by @pd93, [Documentation](http://taskfile.dev/usage/#set-and-shopt)).
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to choose in which platforms that given task or command will be run on. Possible values are operating system (GOOS), architecture (GOARCH) or a combination of the two. Example: `platforms: [linux]`, `platforms: [amd64]` or `platforms: [linux/amd64]`. Other platforms will be skipped (#978, #980 by @leaanthony).
## v3.19.1 - 2022-12-31
- Small bug fix: closing `Taskfile.yml` once we're done reading it (#963, #964 by @HeCorr).
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file (#961, #971 by @pd93).
- Fixed a bug where watch intervals set in the Taskfile were not being respected (#969, #970 by @pd93)
- Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, but we plan to add more info in the near future (#936 by @davidalpert, #764).
## v3.19.0 - 2022-12-05
- Installation via npm now supports [pnpm](https://pnpm.io/) as well ([go-task/go-npm#2](https://github.com/go-task/go-npm/issues/2), [go-task/go-npm#3](https://github.com/go-task/go-npm/pull/3)).
- It's now possible to run Taskfiles from subdirectories! A new `USER_WORKING_DIR` special variable was added to add even more flexibility for monorepos (#289, #920).
- Add task-level `dotenv` support (#389, #904).
- It's now possible to use global level variables on `includes` (#942, #943).
- The website got a brand new [translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by [@DeronW](https://github.com/DeronW). Thanks!
## v3.18.0 - 2022-11-12
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases will be completed by the completion scripts (#919).
- Tasks in the root Taskfile will now be displayed first in `--list`/`--list-all` output (#806, #890).
- It's now possible to call a `default` task in an included Taskfile by using just the namespace. For example: `docs:default` is now automatically aliased to `docs` (#661, #815).
## v3.17.0 - 2022-10-14
- Add a "Did you mean ...?" suggestion when a task does not exits another one with a similar name is found (#867, #880).
- Now YAML parse errors will print which Taskfile failed to parse (#885, #887).
- Add ability to set `aliases` for tasks and namespaces (#268, #340, #879).
- Improvements to Fish shell completion (#897).
- Added ability to set a different watch interval by setting `interval: '500ms'` or using the `--interval=500ms` flag (#813, #865).
- Add colored output to `--list`, `--list-all` and `--summary` flags (#845,
# 874).
- Fix unexpected behavior where `label:` was being shown instead of the task name on `--list` (#603, #877).
## v3.16.0 - 2022-09-29
- Add `npm` as new installation method: `npm i -g @go-task/cli` (#870, #871, [npm package](https://www.npmjs.com/package/@go-task/cli)).
- Add support to marking tasks and includes as internal, which will hide them from `--list` and `--list-all` (#818).
## v3.15.2 - 2022-09-08
- Fix error when using variable in `env:` introduced in the previous release (#858, #866).
- Fix handling of `CLI_ARGS` (`--`) in Bash completion (#863).
- On zsh completion, add ability to replace `--list-all` with `--list` as already possible on the Bash completion (#861).
## v3.15.0 - 2022-09-03
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly requested feature (#215, #857, [Documentation](https://taskfile.dev/api/#special-variables)).
- Follow symlinks on `sources` (#826, #831).
- Improvements and fixes to Bash completion (#835, #844).
## v3.14.1 - 2022-08-03
- Always resolve relative include paths relative to the including Taskfile (#822, #823).
- Fix ZSH and PowerShell completions to consider all tasks instead of just the public ones (those with descriptions) (#803).
## v3.14.0 - 2022-07-08
- Add ability to override the `.task` directory location with the `TASK_TEMP_DIR` environment variable.
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`, `TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`, `TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` (#568, #792).
- Fixed bug when using the `output: group` mode where STDOUT and STDERR were being print in separated blocks instead of in the right order (#779).
- Starting on this release, ARM architecture binaries are been released to Snap as well (#795).
- i386 binaries won't be available anymore on Snap because Ubuntu removed the support for this architecture.
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays (#785, [mvdan/sh#884](https://github.com/mvdan/sh/issues/884), [mvdan/sh#893](https://github.com/mvdan/sh/pull/893)).
## v3.13.0 - 2022-06-13
- Added `-n` as an alias to `--dry` (#776, #777).
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time for the processes running to do cleanup work (#458, #479, #728, #769).
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the command being ran (#755).
## v3.12.1 - 2022-05-10
- Fixed bug where, on Windows, variables were ending with `\r` because we were only removing the final `\n` but not `\r\n` (#717).
## v3.12.0 - 2022-03-31
- The `--list` and `--list-all` flags can now be combined with the `--silent` flag to print the task names only, without their description (#691).
- Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level (#390, #623, #656).
- Add ability to specify vars when including a Taskfile. [Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles) for more information (#677).
## v3.11.0 - 2022-02-19
- Task now supports printing begin and end messages when using the `group` output mode, useful for grouping tasks in CI systems. [Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax) for more information (#647, #651).
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name list. [Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names) for more information (#498, #666).
## v3.10.0 - 2022-01-04
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the exiting `--list` (`-l`) but prints all tasks, even those without a description (#383, #401).
- It's now possible to schedule cleanup commands to run once a task finishes with the `defer:` keyword ([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer),
# 475, #626).
- Remove long deprecated and undocumented `$` variable prefix and `^` command prefix (#642, #644, #645).
- Add support for `.yaml` extension (as an alternative to `.yml`). This was requested multiple times throughout the years. Enjoy! (#183, #184, #369, #584,
# 621).
- Fixed error when computing a variable when the task directory do not exist yet (#481, #579).
## v3.9.2 - 2021-12-02
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains a fix a for a important regression on Windows (#619, [mvdan/sh#768](https://github.com/mvdan/sh/issues/768), [mvdan/sh#769](https://github.com/mvdan/sh/pull/769)).
## v3.9.1 - 2021-11-28
- Add logging in verbose mode for when a task starts and finishes (#533, #588).
- Fix an issue with preconditions and context errors (#597, #598).
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many (#613).
- Fix nil pointer when `cmd:` was left empty (#612, #614).
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant fixes:
- Fix quote of empty strings in `shellQuote` (#609, [mvdan/sh#763](https://github.com/mvdan/sh/issues/763)).
- Fix issue of wrong environment variable being picked when there's another very similar one (#586, [mvdan/sh#745](https://github.com/mvdan/sh/pull/745)).
- Install shell completions automatically when installing via Homebrew (#264, #592, [go-task/homebrew-tap#2](https://github.com/go-task/homebrew-tap/pull/2)).
## v3.9.0 - 2021-10-02
- A new `shellQuote` function was added to the template system (`{{shellQuote "a string"}}`) to ensure a string is safe for use in shell ([mvdan/sh#727](https://github.com/mvdan/sh/pull/727), [mvdan/sh#737](https://github.com/mvdan/sh/pull/737), [Documentation](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote))
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with some small fixes and features
- The `read -p` flag is now supported (#314, [mvdan/sh#551](https://github.com/mvdan/sh/issues/551), [mvdan/sh#772](https://github.com/mvdan/sh/pull/722))
- The `pwd -P` and `pwd -L` flags are now supported (#553, [mvdan/sh#724](https://github.com/mvdan/sh/issues/724), [mvdan/sh#728](https://github.com/mvdan/sh/pull/728))
- The `$GID` environment variable is now correctly being set (#561, [mvdan/sh#723](https://github.com/mvdan/sh/pull/723))
## v3.8.0 - 2021-09-26
- Add `interactive: true` setting to improve support for interactive CLI apps (#217, #563).
- Fix some `nil` errors (#534, #573).
- Add ability to declare an included Taskfile as optional (#519, #552).
- Add support for including Taskfiles in the home directory by using `~` (#539, #557).
## v3.7.3 - 2021-09-04
- Add official support to Apple M1 (#564, #567).
- Our [official Homebrew tap](https://github.com/go-task/homebrew-tap) will support more platforms, including Apple M1
## v3.7.0 - 2021-07-31
- Add `run:` setting to control if tasks should run multiple times or not. Available options are `always` (the default), `when_changed` (if a variable modified the task) and `once` (run only once no matter what). This is a long time requested feature. Enjoy! (#53, #359).
## v3.6.0 - 2021-07-10
- Allow using both `sources:` and `status:` in the same task (#411, #427, #477).
- Small optimization and bug fix: don't compute variables if not needed for `dotenv:` (#517).
## v3.5.0 - 2021-07-04
- Add support for interpolation in `dotenv:` (#433, #434, #453).
## v3.4.3 - 2021-05-30
- Add support for the `NO_COLOR` environment variable. (#459, [fatih/color#137](https://github.com/fatih/color/pull/137)).
- Fix bug where sources were not considering the right directory in `--watch` mode (#484, #485).
## v3.4.2 - 2021-04-23
- On watch, report which file failed to read (#472).
- Do not try to catch SIGKILL signal, which are not actually possible (#476).
- Improve version reporting when building Task from source using Go Modules (#462, #473).
## v3.4.1 - 2021-04-17
- Improve error reporting when parsing YAML: in some situations where you would just see an generic error, you'll now see the actual error with more detail: the YAML line the failed to parse, for example (#467).
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json) and is automatically being used by some editors like Visual Studio Code (#135).
- Print task name before the command in the log output (#398).
## v3.3.0 - 2021-03-20
- Add support for delegating CLI arguments to commands with `--` and a special `CLI_ARGS` variable (#327).
- Add a `--concurrency` (alias `-C`) flag, to limit the number of tasks that run concurrently. This is useful for heavy workloads. (#345).
## v3.2.2 - 2021-01-12
- Improve performance of `--list` and `--summary` by skipping running shell variables for these flags (#332).
- Fixed a bug where an environment in a Taskfile was not always overridable by the system environment (#425).
- Fixed environment from .env files not being available as variables (#379).
- The install script is now working for ARM platforms (#428).
## v3.2.1 - 2021-01-09
- Fixed some bugs and regressions regarding dynamic variables and directories (#426).
- The [slim-sprig](https://github.com/go-task/slim-sprig) package was updated with the upstream [sprig](https://github.com/Masterminds/sprig).
## v3.2.0 - 2021-01-07
- Fix the `.task` directory being created in the task directory instead of the Taskfile directory (#247).
- Fix a bug where dynamic variables (those declared with `sh:`) were not running in the task directory when the task has a custom dir or it was in an included Taskfile (#384).
- The watch feature (via the `--watch` flag) got a few different bug fixes and should be more stable now (#423, #365).
## v3.1.0 - 2021-01-03
- Fix a bug when the checksum up-to-date resolution is used by a task with a custom `label:` attribute (#412).
- Starting from this release, we're releasing official ARMv6 and ARM64 binaries for Linux (#375, #418).
- Task now respects the order of declaration of included Taskfiles when evaluating variables declaring by them (#393).
- `set -e` is now automatically set on every command. This was done to fix an issue where multiline string commands wouldn't really fail unless the sentence was in the last line (#403).
## v3.0.1 - 2020-12-26
- Allow use as a library by moving the required packages out of the `internal` directory (#358).
- Do not error if a specified dotenv file does not exist (#378, #385).
- Fix panic when you have empty tasks in your Taskfile (#338, #362).
## v3.0.0 - 2020-08-16
- On `v3`, all CLI variables will be considered global variables (#336, #341)
- Add support to `.env` like files (#324, #356).
- Add `label:` to task so you can override the task name in the logs (#321,
# 337).
- Refactor how variables work on version 3 (#311).
- Disallow `expansions` on v3 since it has no effect.
- `Taskvars.yml` is not automatically included anymore.
- `Taskfile_{{OS}}.yml` is not automatically included anymore.
- Allow interpolation on `includes`, so you can manually include a Taskfile based on operation system, for example.
- Expose `.TASK` variable in templates with the task name (#252).
- Implement short task syntax (#194, #240).
- Added option to make included Taskfile run commands on its own directory (#260, #144)
- Taskfiles in version 1 are not supported anymore (#237).
- Added global `method:` option. With this option, you can set a default method to all tasks in a Taskfile (#246).
- Changed default method from `timestamp` to `checksum` (#246).
- New magic variables are now available when using `status:`: `.TIMESTAMP` which contains the greatest modification date from the files listed in `sources:`, and `.CHECKSUM`, which contains a checksum of all files listed in `status:`. This is useful for manual checking when using external, or even remote, artifacts when using `status:` (#216).
- We're now using [slim-sprig](https://github.com/go-task/slim-sprig) instead of [sprig](https://github.com/Masterminds/sprig), which allowed a file size reduction of about 22% (#219).
- We now use some colors on Task output to better distinguish message types - commands are green, errors are red, etc (#207).
## v2.8.1 - 2020-05-20
- Fix error code for the `--help` flag (#300, #330).
- Print version to stdout instead of stderr (#299, #329).
- Supress `context` errors when using the `--watch` flag (#313, #317).
- Support templating on description (#276, #283).
## v2.8.0 - 2019-12-07
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel (#266).
- Fixed bug where calling the `task` CLI only informing global vars would not execute the `default` task.
- Add hability to silent all tasks by adding `silent: true` a the root of the Taskfile.
## v2.7.1 - 2019-11-10
- Fix error being raised when `exit 0` was called (#251).
## v2.7.0 - 2019-09-22
- Fixed panic bug when assigning a global variable (#229, #243).
- A task with `method: checksum` will now re-run if generated files are deleted (#228, #238).
## v2.6.0 - 2019-07-21
- Fixed some bugs regarding minor version checks on `version:`.
- Add `preconditions:` to task (#205).
- Create directory informed on `dir:` if it doesn't exist (#209, #211).
- We now have a `--taskfile` flag (alias `-t`), which can be used to run another Taskfile (other than the default `Taskfile.yml`) (#221).
- It's now possible to install Task using Homebrew on Linux ([go-task/homebrew-tap#1](https://github.com/go-task/homebrew-tap/pull/1)).
## v2.5.2 - 2019-05-11
- Reverted YAML upgrade due issues with CRLF on Windows (#201, [go-yaml/yaml#450](https://github.com/go-yaml/yaml/issues/450)).
- Allow setting global variables through the CLI (#192).
## 2.5.1 - 2019-04-27
- Fixed some issues with interactive command line tools, where sometimes the output were not being shown, and similar issues (#114, #190, #200).
- Upgraded [go-yaml/yaml](https://github.com/go-yaml/yaml) from v2 to v3.
## v2.5.0 - 2019-03-16
- We moved from the taskfile.org domain to the new fancy taskfile.dev domain. While stuff is being redirected, we strongly recommend to everyone that use [this install script](https://taskfile.dev/#/installation?id=install-script) to use the new taskfile.dev domain on scripts from now on.
- Fixed to the ZSH completion (#182).
- Add [`--summary` flag along with `summary:` task attribute](https://taskfile.org/#/usage?id=display-summary-of-task) (#180).
## v2.4.0 - 2019-02-21
- Allow calling a task of the root Taskfile from an included Taskfile by prefixing it with `:` (#161, #172).
- Add flag to override the `output` option (#173).
- Fix bug where Task was persisting the new checksum on the disk when the Dry Mode is enabled (#166).
- Fix file timestamp issue when the file name has spaces (#176).
- Mitigating path expanding issues on Windows (#170).
## v2.3.0 - 2019-01-02
- On Windows, Task can now be installed using [Scoop](https://scoop.sh/) (#152).
- Fixed issue with file/directory globing (#153).
- Added ability to globally set environment variables (#138, #159).
## v2.2.1 - 2018-12-09
- This repository now uses Go Modules (#143). We'll still keep the `vendor` directory in sync for some time, though;
- Fixing a bug when the Taskfile has no tasks but includes another Taskfile (#150);
- Fix a bug when calling another task or a dependency in an included Taskfile (#151).
## v2.2.0 - 2018-10-25
- Added support for [including other Taskfiles](https://taskfile.org/#/usage?id=including-other-taskfiles) (#98)
- This should be considered experimental. For now, only including local files is supported, but support for including remote Taskfiles is being discussed. If you have any feedback, please comment on #98.
- Task now have a dedicated documentation site: https://taskfile.org
- Thanks to [Docsify](https://docsify.js.org/) for making this pretty easy. To check the source code, just take a look at the [docs](https://github.com/go-task/task/tree/main/docs) directory of this repository. Contributions to the documentation is really appreciated.
## v2.1.1 - 2018-09-17
- Fix suggestion to use `task --init` not being shown anymore (when a `Taskfile.yml` is not found)
- Fix error when using checksum method and no file exists for a source glob (#131)
- Fix signal handling when the `--watch` flag is given (#132)
## v2.1.0 - 2018-08-19
- Add a `ignore_error` option to task and command (#123)
- Add a dry run mode (`--dry` flag) (#126)
## v2.0.3 - 2018-06-24
- Expand environment variables on "dir", "sources" and "generates" (#116)
- Fix YAML merging syntax (#112)
- Add ZSH completion (#111)
- Implement new `output` option. Please check out the [documentation](https://github.com/go-task/task#output-syntax)
## v2.0.2 - 2018-05-01
- Fix merging of YAML anchors (#112)
## v2.0.1 - 2018-03-11
- Fixes panic on `task --list`
## v2.0.0 - 2018-03-08
Version 2.0.0 is here, with a new Taskfile format.
Please, make sure to read the [Taskfile versions](https://github.com/go-task/task/blob/main/TASKFILE_VERSIONS.md) document, since it describes in depth what changed for this version.
- New Taskfile version 2 (#77)
- Possibility to have global variables in the `Taskfile.yml` instead of `Taskvars.yml` (#66)
- Small improvements and fixes
## v1.4.4 - 2017-11-19
- Handle SIGINT and SIGTERM (#75);
- List: print message with there's no task with description;
- Expand home dir ("~" symbol) on paths (#74);
- Add Snap as an installation method;
- Move examples to its own repo;
- Watch: also walk on tasks called on on "cmds", and not only on "deps";
- Print logs to stderr instead of stdout (#68);
- Remove deprecated `set` keyword;
- Add checksum based status check, alternative to timestamp based.
## v1.4.3 - 2017-09-07
- Allow assigning variables to tasks at run time via CLI (#33)
- Added suport for multiline variables from sh (#64)
- Fixes env: remove square braces and evaluate shell (#62)
- Watch: change watch library and few fixes and improvements
- When use watching, cancel and restart long running process on file change (#59 and #60)
## v1.4.2 - 2017-07-30
- Flag to set directory of execution
- Always echo command if is verbose mode
- Add silent mode to disable echoing of commands
- Fixes and improvements of variables (#56)
## v1.4.1 - 2017-07-15
- Allow use of YAML for dynamic variables instead of $ prefix
- `VAR: {sh: echo Hello}` instead of `VAR: $echo Hello`
- Add `--list` (or `-l`) flag to print existing tasks
- OS specific Taskvars file (e.g. `Taskvars_windows.yml`, `Taskvars_linux.yml`, etc)
- Consider task up-to-date on equal timestamps (#49)
- Allow absolute path in generates section (#48)
- Bugfix: allow templating when calling deps (#42)
- Fix panic for invalid task in cyclic dep detection
- Better error output for dynamic variables in Taskvars.yml (#41)
- Allow template evaluation in parameters
## v1.4.0 - 2017-07-06
- Cache dynamic variables
- Add verbose mode (`-v` flag)
- Support to task parameters (overriding vars) (#31) (#32)
- Print command, also when "set:" is specified (#35)
- Improve task command help text (#35)
## v1.3.1 - 2017-06-14
- Fix glob not working on commands (#28)
- Add ExeExt template function
- Add `--init` flag to create a new Taskfile
- Add status option to prevent task from running (#27)
- Allow interpolation on `generates` and `sources` attributes (#26)
## v1.3.0 - 2017-04-24
- Migrate from os/exec.Cmd to a native Go sh/bash interpreter
- This is a potentially breaking change if you use Windows.
- Now, `cmd` is not used anymore on Windows. Always use Bash-like syntax for your commands, even on Windows.
- Add "ToSlash" and "FromSlash" to template functions
- Use functions defined on github.com/Masterminds/sprig
- Do not redirect stdin while running variables commands
- Using `context` and `errgroup` packages (this will make other tasks to be cancelled, if one returned an error)
## v1.2.0 - 2017-04-02
- More tests and Travis integration
- Watch a task (experimental)
- Possibility to call another task
- Fix "=" not being reconized in variables/environment variables
- Tasks can now have a description, and help will print them (#10)
- Task dependencies now run concurrently
- Support for a default task (#16)
## v1.1.0 - 2017-03-08
- Support for YAML, TOML and JSON (#1)
- Support running command in another directory (#4)
- `--force` or `-f` flag to force execution of task even when it's up-to-date
- Detection of cyclic dependencies (#5)
- Support for variables (#6, #9, #14)
- Operation System specific commands and variables (#13)
## v1.0.0 - 2017-02-28
- Add LICENSE file

View File

@@ -0,0 +1,33 @@
---
slug: /community/
sidebar_position: 9
---
# Community
Some of the work to improve the Task ecosystem is done by the community, be it installation methods or integrations with code editor. I (the author) am thankful for everyone that helps me to improve the overall experience.
## Translations
We use [Crowdin](https://crowdin.com/project/taskfile) to translate our document.
## Integrations
Many of our integrations are contributed and maintained by the community. You can view the full list of community integrations [here](/integrations#community-integrations).
## Installation methods
Some installation methods are maintained by third party:
- [GitHub Actions](https://github.com/arduino/setup-task) by @arduino
- [AUR](https://aur.archlinux.org/packages/go-task-bin) by @carlsmedstad
- [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)
- [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
- [NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/go-task/default.nix)
- [Conda](https://github.com/conda-forge/go-task-feedstock/)
## More
Also, thanks for all the [code contributors](https://github.com/go-task/task/graphs/contributors), [financial contributors](https://opencollective.com/task), all those who [reported bugs](https://github.com/go-task/task/issues?q=is%3Aissue) and [answered questions](https://github.com/go-task/task/discussions).
If you know something that is missing in this document, please submit a pull request.

View File

@@ -0,0 +1,101 @@
---
slug: /contributing/
sidebar_position: 11
---
# Contributing
Contributions to Task are very welcome, but we ask that you read this document before submitting a PR.
:::note
This document applies to the core [Task][task] repository _and_ [Task for Visual Studio Code][vscode-task].
:::
## Before you start
- **Check existing work** - Is there an existing PR? Are there issues discussing the feature/change you want to make? Please make sure you consider/address these discussions in your work.
- **Backwards compatibility** - Will your change break existing Taskfiles? It is much more likely that your change will merged if it backwards compatible. Is there an approach you can take that maintains this compatibility? If not, consider opening an issue first so that API changes can be discussed before you invest your time into a PR.
- **Experiments** - If there is no way to make your change backward compatible then there is a procedure to introduce breaking changes into minor versions. We call these "\[experiments\]\[experiments\]". If you're intending to work on an experiment, then please read the \[experiments workflow\]\[experiments-workflow\] document carefully and submit a proposal first.
## 1. Setup
- **Go** - Task is written in [Go][go]. We always support the latest two major Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js][nodejs] is used to host Task's documentation server and is required if you want to run this server locally. It is also required if you want to contribute to the Visual Studio Code extension.
- **Yarn** - [Yarn][yarn] is the Node.js package manager used by Task.
## 2. Making changes
- **Code style** - Try to maintain the existing code style where possible. Go code should be formatted by [`gofumpt`][gofumpt] and linted using [`golangci-lint`][golangci-lint]. Any Markdown or TypeScript files should be formatted and linted by [Prettier][prettier]. This style is enforced by our CI to ensure that we have a consistent style across the project. You can use the `task lint` command to lint the code locally and the `task lint:fix` command to automatically fix any issues that are found.
- **Documentation** - Ensure that you add/update any relevant documentation. See the [updating documentation](#updating-documentation) section below.
- **Tests** - Ensure that you add/update any relevant tests and that all tests are passing before submitting the PR. See the [writing tests](#writing-tests) section below.
### Running your changes
To run Task with working changes, you can use `go run ./cmd/task`. To run a development build of task against a test Taskfile in `testdata`, you can use `go run ./cmd/task --dir ./testdata/<my_test_dir> <task_name>`.
To run Task for Visual Studio Code, you can open the project in VSCode and hit F5 (or whatever you debug keybind is set to). This will open a new VSCode window with the extension running. Debugging this way is recommended as it will allow you to set breakpoints and step through the code. Otherwise, you can run `task package` which will generate a `.vsix` file that can be used to manually install the extension.
### Updating documentation
Task uses [Docusaurus][docusaurus] to host a documentation server. The code for this is located in the core Task repository. This can be setup and run locally by using `task docs` (requires `nodejs` & `yarn`). All content is written in Markdown and is located in the `docs/docs` directory. All Markdown documents should have an 80 character line wrap limit (enforced by Prettier).
When making a change, consider whether a change to the [Usage Guide](/usage) is necessary. This document contains descriptions and examples of how to use Task features. If you're adding a new feature, try to find an appropriate place to add a new section. If you're updating an existing feature, ensure that the documentation and any examples are up-to-date. Ensure that any examples follow the [Taskfile Styleguide](/styleguide).
If you added a new field, command or flag, ensure that you add it to the [API Reference](/api). New fields also need to be added to the [JSON Schema][json-schema]. The descriptions for fields in the API reference and the schema should match.
### Writing tests
A lot of Task's tests are held in the `task_test.go` file in the project root and this is where you'll most likely want to add new ones too. Most of these tests also have a subdirectory in the `testdata` directory where any Taskfiles/data required to run the tests are stored.
When making a changes, consider whether new tests are required. These tests should ensure that the functionality you are adding will continue to work in the future. Existing tests may also need updating if you have changed Task's behavior.
You may also consider adding unit tests for any new functions you have added. The unit tests should follow the Go convention of being location in a file named `*_test.go` in the same package as the code being tested.
## 3. Committing your code
Try to write meaningful commit messages and avoid having too many commits on the PR. Most PRs should likely have a single commit (although for bigger PRs it may be reasonable to split it in a few). Git squash and rebase is your friend!
If you're not sure how to format your commit message, check out [Conventional Commits][conventional-commits]. This style is not enforced, but it is a good way to make your commit messages more readable and consistent.
## 4. Submitting a PR
- **Describe your changes** - Ensure that you provide a comprehensive description of your changes.
- **Issue/PR links** - Link any previous work such as related issues or PRs. Please describe how your changes differ to/extend this work.
- **Examples** - Add any examples or screenshots that you think are useful to demonstrate the effect of your changes.
- **Draft PRs** - If your changes are incomplete, but you would like to discuss them, open the PR as a draft and add a comment to start a discussion. Using comments rather than the PR description allows the description to be updated later while preserving any discussions.
## FAQ
> I want to contribute, where do I start?
Take a look at the list of [open issues for Task][task-open-issues] or [Task for Visual Studio Code][vscode-task-open-issues]. We have a [good first issue][good-first-issue] label for simpler issues that are ideal for first time contributions.
All kinds of contributions are welcome, whether its a typo fix or a shiny new feature. You can also contribute by upvoting/commenting on issues, helping to answer questions or contributing to other [community projects](/community).
> I'm stuck, where can I get help?
If you have questions, feel free to ask them in the `#help` forum channel on our [Discord server][discord-server] or open a [Discussion][discussion] on GitHub.
---
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[task]: https://github.com/go-task/task
[vscode-task]: https://github.com/go-task/vscode-task
[go]: https://go.dev
[gofumpt]: https://github.com/mvdan/gofumpt
[golangci-lint]: https://golangci-lint.run
[prettier]: https://prettier.io
[nodejs]: https://nodejs.org/en/
[yarn]: https://yarnpkg.com/
[docusaurus]: https://docusaurus.io
[json-schema]: https://github.com/go-task/task/blob/main/docs/static/schema.json
[task-open-issues]: https://github.com/go-task/task/issues
[vscode-task-open-issues]: https://github.com/go-task/vscode-task/issues
[good-first-issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[discord-server]: https://discord.gg/6TY36E39UK
[discussion]: https://github.com/go-task/task/discussions
[conventional-commits]: https://www.conventionalcommits.org

View File

@@ -0,0 +1,12 @@
---
slug: /deprecations/
sidebar_position: 7
---
# Deprecations
As Task evolves, it occasionally outgrows some of its functionality. This can be because they are no longer useful, because another feature has replaced it or because of a change in the way that Task works internally.
When this happens, we mark the functionality as deprecated. This means that it will be removed in a future version of Task. This functionality will continue to work until that time, but we strongly recommend that you do not implement this functionality in new Taskfiles and make a plan to migrate away from it as soon as possible.
You can view a full list of active deprecations in the "Deprecations" section of the sidebar.

View File

@@ -0,0 +1,22 @@
---
#This is a template for an experiments documentation
#Copy this page and fill in the details as necessary
title: '--- Template ---'
sidebar_position: -1 #Always push to the top
draft: true #Hide in production
---
# \{Name of Deprecated Feature\} (#\{Issue\})
:::warning
This deprecation breaks the following functionality:
- \{list any existing functionality that will be broken by this deprecation\}
- \{if there are no breaking changes, remove this admonition\}
:::
\{Short description of the feature/behavior and why it is being deprecated\}
\{Short explanation of any replacement features/behaviors and how users should migrate to it\}

View File

@@ -0,0 +1,25 @@
---
slug: /deprecations/version-2-schema/
---
# Version 2 Schema (#1197)
:::warning
This deprecation breaks the following functionality:
- Any Taskfiles that use the version 2 schema
- `Taskvar.yml` files
:::
The Taskfile version 2 schema was introduced in March 2018 and replaced by version 3 in August 2019. In May 2023 [we published a deprecation notice][deprecation-notice] for the version 2 schema on the basis that the vast majority of users had already upgraded to version 3 and removing support for version 2 would allow us to tidy up the codebase and focus on new functionality instead.
In December 2023, the final version of Task that supports the version 2 schema ([v3.33.0][v3.33.0]) was published and all legacy code was removed from Task's main branch. To use a more recent version of Task, you will need to ensure that your Taskfile uses the version 3 schema instead. A list of changes between version 2 and version 3 are available in the [Task v3 Release Notes][v3.0.0].
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[v3.0.0]: https://github.com/go-task/task/releases/tag/v3.0.0
[v3.33.0]: https://github.com/go-task/task/releases/tag/v3.33.0
[deprecation-notice]: https://github.com/go-task/task/issues/1197

View File

@@ -0,0 +1,44 @@
---
slug: /donate/
sidebar_position: 16
---
# Donate
If you find this project useful, you can consider donating by using one of the channels listed below.
This is just a way of saying "thank you", it won't give you any benefits like higher priority on issues or something similar.
Companies who donate at least $50/month will be featured as a "Gold Sponsor" in the website homepage and on the GitHub repository README. Make contact with [@andreynering][] with the logo you want to be shown. Suspect businesses (gambling, casinos, etc) won't be allowed, though.
## GitHub Sponsors
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use the following links to do your donation. We suggest a 50/50 split to each maintainer of the total amount you plan to donate to the project.
- [@andreynering](https://github.com/sponsors/andreynering)
- [@pd93](https://github.com/sponsors/pd93)
## Open Collective
If you prefer [Open Collective](https://opencollective.com/task) you can donate by using these links:
- [$2 per month](https://opencollective.com/task/contribute/backer-4034/checkout)
- [$5 per month](https://opencollective.com/task/contribute/supporter-8404/checkout)
- [$20 per month](https://opencollective.com/task/contribute/sponsor-4035/checkout)
- [$50 per month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
- [Custom value - One-time donation option supported](https://opencollective.com/task/donate)
## PayPal
You can donate to [@andreynering][] via PayPal as well:
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
## PIX (Brazil only)
And if you're Brazilian, you can also donate to [@andreynering][] via PIX by [using this QR Code](/img/pix.png).
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[@andreynering]: https://github.com/andreynering

View File

@@ -0,0 +1,206 @@
---
slug: /experiments/any-variables/
---
# Any Variables (#1415)
:::caution
All experimental features are subject to breaking changes and/or removal _at any
time_. We strongly recommend that you do not use these features in a production
environment. They are intended for testing and feedback only.
:::
:::warning
This experiment breaks the following functionality:
- Dynamically defined variables (using the `sh` keyword)
:::
:::info
To enable this experiment, set the environment variable:
`TASK_X_ANY_VARIABLES=1`. Check out [our guide to enabling experiments
][enabling-experiments] for more information.
:::
Currently, Task only supports string variables. This experiment allows you to
specify and use the following variable types:
- `string`
- `bool`
- `int`
- `float`
- `array`
- `map`
This allows you to have a lot more flexibility in how you use variables in
Task's templating engine. For example:
Evaluating booleans:
```yaml
version: 3
tasks:
foo:
vars:
BOOL: false
cmds:
- '{{if .BOOL}}echo foo{{end}}'
```
Arithmetic:
```yaml
version: 3
tasks:
foo:
vars:
INT: 10
FLOAT: 3.14159
cmds:
- 'echo {{add .INT .FLOAT}}'
```
Ranging:
```yaml
version: 3
tasks:
foo:
vars:
ARRAY: [1, 2, 3]
cmds:
- 'echo {{range .ARRAY}}{{.}}{{end}}'
```
There are many more templating functions which can be used with the new types of
variables. For a full list, see the [slim-sprig][slim-sprig] documentation.
## Looping over variables
Previously, you would have to use a delimiter separated string to loop over an
arbitrary list of items in a variable and split them by using the `split` subkey
to specify the delimiter:
```yaml
version: 3
tasks:
foo:
vars:
LIST: 'foo,bar,baz'
cmds:
- for:
var: LIST
split: ','
cmd: echo {{.ITEM}}
```
Because this experiment adds support for "collection-type" variables, the `for`
keyword has been updated to support looping over arrays directly:
```yaml
version: 3
tasks:
foo:
vars:
LIST: [foo, bar, baz]
cmds:
- for:
var: LIST
cmd: echo {{.ITEM}}
```
This also works for maps. When looping over a map we also make an additional
`{{.KEY}}` variable availabe that holds the string value of the map key.
Remember that maps are unordered, so the order in which the items are looped
over is random:
```yaml
version: 3
tasks:
foo:
vars:
MAP:
KEY_1:
SUBKEY: sub_value_1
KEY_2:
SUBKEY: sub_value_2
KEY_3:
SUBKEY: sub_value_3
cmds:
- for:
var: MAP
cmd: echo {{.KEY}} {{.ITEM.SUBKEY}}
```
String splitting is still supported and remember that for simple cases, you have
always been able to loop over an array without using variables at all:
```yaml
version: 3
tasks:
foo:
cmds:
- for: [foo, bar, baz]
cmd: echo {{.ITEM}}
```
## Migration
Taskfiles with dynamically defined variables via the `sh` subkey will no longer
work with this experiment enabled. In order to keep using dynamically defined
variables, you will need to migrate your Taskfile to use the new syntax.
Previously, you might have defined a dynamic variable like this:
```yaml
version: 3
task:
foo:
vars:
CALCULATED_VAR:
sh: 'echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
With this experiment enabled, you will need to remove the `sh` subkey and define
your command as a string that begins with a `$`. This will instruct Task to
interpret the string as a command instead of a literal value and the variable
will be populated with the output of the command. For example:
```yaml
version: 3
task:
foo:
vars:
CALCULATED_VAR: '$echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
If your current Taskfile contains a string variable that begins with a `$`, you
will now need to escape the `$` with a backslash (`\`) to stop Task from
executing it as a command.
<!-- prettier-ignore-start -->
[enabling-experiments]: /experiments/#enabling-experiments
[slim-sprig]: https://go-task.github.io/slim-sprig/
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,162 @@
---
slug: /experiments/any-variables/
---
# Any Variables
- Issue: #1415
- Environment variable: `TASK_X_ANY_VARIABLES=1`
- Breaks:
- Dynamically defined variables (using the `sh` keyword)
Currently, Task only supports string variables. This experiment allows you to
specify and use the following variable types:
- `string`
- `bool`
- `int`
- `float`
- `array`
- `map`
This allows you to have a lot more flexibility in how you use variables in
Task's templating engine. For example:
Evaluating booleans:
```yaml
version: 3
tasks:
foo:
vars:
BOOL: false
cmds:
- '{{if .BOOL}}echo foo{{end}}'
```
Arithmetic:
```yaml
version: 3
tasks:
foo:
vars:
INT: 10
FLOAT: 3.14159
cmds:
- 'echo {{add .INT .FLOAT}}'
```
Ranging:
```yaml
version: 3
tasks:
foo:
vars:
ARRAY: [1, 2, 3]
cmds:
- 'echo {{range .ARRAY}}{{.}}{{end}}'
```
There are many more templating functions which can be used with the new types of
variables. For a full list, see the
[slim-sprig][slim-sprig] documentation.
## Looping over variables
Previously, you would have to use a delimiter separated string to loop over an
arbitrary list of items in a variable and split them by using the `split` subkey
to specify the delimiter:
```yaml
version: 3
tasks:
foo:
vars:
LIST: 'foo,bar,baz'
cmds:
- for:
var: LIST
split: ','
cmd: echo {{.ITEM}}
```
Because this experiment adds support for array variables, the `for` keyword has
been updated to support looping over arrays directly:
```yaml
version: 3
tasks:
foo:
vars:
LIST: [foo, bar, baz]
cmds:
- for:
var: LIST
cmd: echo {{.ITEM}}
```
String splitting is still supported and remember that for simple cases, you have
always been able to loop over an array without using variables at all:
```yaml
version: 3
tasks:
foo:
cmds:
- for: [foo, bar, baz]
cmd: echo {{.ITEM}}
```
## Migration
Taskfiles with dynamically defined variables via the `sh` subkey will no longer
work with this experiment enabled. In order to keep using dynamically defined
variables, you will need to migrate your Taskfile to use the new syntax.
Previously, you might have defined a dynamic variable like this:
```yaml
version: 3
task:
foo:
vars:
CALCULATED_VAR:
sh: 'echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
With this experiment enabled, you will need to remove the `sh` subkey and define
your command as a string that begins with a `$`. This will instruct Task to
interpret the string as a command instead of a literal value and the variable
will be populated with the output of the command. For example:
```yaml
version: 3
task:
foo:
vars:
CALCULATED_VAR: '$echo hello'
cmds:
- 'echo {{.CALCULATED_VAR}}'
```
If your current Taskfile contains a string variable that begins with a `$`, you
will now need to escape the `$` with a backslash (`\`) to stop Task from
executing it as a command.
<!-- prettier-ignore-start -->
[slim-sprig]: https://go-task.github.io/slim-sprig/
<!-- prettier-ignore-end -->

View File

@@ -0,0 +1,79 @@
---
slug: /experiments/
sidebar_position: 6
---
# Experiments
:::caution
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production environment. They are intended for testing and feedback only.
:::
In order to allow Task to evolve quickly, we roll out breaking changes to minor versions behind experimental flags. This allows us to gather feedback on breaking changes before committing to a major release. This document describes the current set of experimental features and their status in the [workflow](#workflow).
You can view a full list of active experiments in the "Experiments" section of the sidebar.
## Enabling Experiments
You can enable an experimental feature by doing one of the following:
1. Using the relevant environment variable in front of a task command. For example, `TASK_X_{FEATURE}=1 task {my-task}`. This is intended for one-off invocations of Task to test out experimental features.
1. Using the relevant environment variable in your "dotfiles" (e.g. `.bashrc`, `.zshrc` etc.). This is intended for permanently enabling experimental features in your environment.
1. Creating a `.env` file in the same directory as your root Taskfile that contains the relevant environment variables. This allows you to enable an experimental feature at a project level. For example:
```shell title=".env"
TASK_X_FEATURE=1
```
## Current Experimental Features and Deprecations
Each section below details an experiment or deprecation and explains what the flags/environment variables to enable the experiment are and how the feature's behavior will change. It will also explain what you need to do to migrate any existing Taskfiles to the new behavior.
## Workflow
Experiments are a way for us to test out new features in Task before committing to them in a major release. Because this concept is built around the idea of feedback from our community, we have built a workflow for the process of introducing these changes. This ensures that experiments are given the attention and time that they need and that we are getting the best possible results out of them.
The sections below describe the various stages that an experiment must go through from its proposal all the way to being released in a major version of Task.
### 1. Proposal
All experimental features start with a proposal in the form of a GitHub issue. If the maintainers decide that an issue has enough support and is a breaking change or is complex/controversial enough to require user feedback, then the issue will be marked with the ![proposal][] label. At this point, the issue becomes a proposal and a period of consultation begins. During this period, we request that users provide feedback on the proposal and how it might effect their use of Task. It is up to the discretion of the maintainers to decide how long this period lasts.
### 2. Draft
Once a proposal's consultation ends, a contributor may pick up the work and begin the initial implementation. Once a PR is opened, the maintainers will ensure that it meets the requirements for an experimental feature (i.e. flags are in the right format etc) and merge the feature. Once this code is released, the status will be updated via the ![draft][] label. This indicates that an implementation is now available for use in a release and the experiment is open for feedback.
:::note
During the draft period, major changes to the implementation may be made based on the feedback received from users. There are _no stability guarantees_ and experimental features may be abandoned _at any time_.
:::
### 3. Candidate
Once an acceptable level of consensus has been reached by the community and feedback/changes are less frequent/significant, the status may be updated via the ![candidate][] label. This indicates that a proposal is _likely_ to accepted and will enter a period for final comments and minor changes.
### 4. Stable
Once a suitable amount of time has passed with no changes or feedback, an experiment will be given the ![stable][] label. At this point, the functionality will be treated like any other feature in Task and any changes _must_ be backward compatible. This allows users to migrate to the new functionality without having to worry about anything breaking in future releases. This provides the best experience for users migrating to a new major version.
### 5. Released
When making a new major release of Task, all experiments marked as ![stable][] will move to ![released][] and their behaviors will become the new default in Task. Experiments in an earlier stage (i.e. not stable) cannot be released and so will continue to be experiments in the new version.
### Abandoned / Superseded
If an experiment is unsuccessful at any point then it will be given the ![abandoned][] or ![superseded][] labels depending on which is more suitable. These experiments will be removed from Task.
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[proposal]: https://img.shields.io/badge/experiment:%20proposal-purple
[draft]: https://img.shields.io/badge/experiment:%20draft-purple
[candidate]: https://img.shields.io/badge/experiment:%20candidate-purple
[stable]: https://img.shields.io/badge/experiment:%20stable-purple
[released]: https://img.shields.io/badge/experiment:%20released-purple
[abandoned]: https://img.shields.io/badge/experiment:%20abandoned-purple
[superseded]: https://img.shields.io/badge/experiment:%20superseded-purple

View File

@@ -0,0 +1,36 @@
---
slug: /experiments/gentle-force/
---
# Gentle Force (#1200)
:::caution
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production environment. They are intended for testing and feedback only.
:::
:::warning
This experiment breaks the following functionality:
- The `--force` flag
:::
:::info
To enable this experiment, set the environment variable: `TASK_X_FORCE=1`. Check out [our guide to enabling experiments ][enabling-experiments] for more information.
:::
The `--force` flag currently forces _all_ tasks to run regardless of the status checks. This can be useful, but we have found that most of the time users only expect the direct task they are calling to be forced and _not_ all of its dependant tasks.
This experiment changes the `--force` flag to only force the directly called task. All dependant tasks will have their statuses checked as normal and will only run if Task considers them to be out of date. A new `--force-all` flag will also be added to maintain the current behavior for users that need this functionality.
If you want to migrate, but continue to force all dependant tasks to run, you should replace all uses of the `--force` flag with `--force-all`. Alternatively, if you want to adopt the new behavior, you can continue to use the `--force` flag as you do now!
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[enabling-experiments]: /experiments/#enabling-experiments

View File

@@ -0,0 +1,66 @@
---
slug: /experiments/remote-taskfiles/
---
# Remote Taskfiles (#1317)
:::caution
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production environment. They are intended for testing and feedback only.
:::
:::info
To enable this experiment, set the environment variable: `TASK_X_REMOTE_TASKFILES=1`. Check out [our guide to enabling experiments ][enabling-experiments] for more information.
:::
This experiment allows you to specify a remote Taskfile URL when including a Taskfile. For example:
```yaml
version: '3'
includes:
my-remote-namespace: https://raw.githubusercontent.com/my-org/my-repo/main/Taskfile.yml
```
This works exactly the same way that including a local file does. Any tasks in the remote Taskfile will be available to run from your main Taskfile via the namespace `my-remote-namespace`. For example, if the remote file contains the following:
```yaml
version: '3'
tasks:
hello:
silent: true
cmds:
- echo "Hello from the remote Taskfile!"
```
and you run `task my-remote-namespace:hello`, it will print the text: "Hello from the remote Taskfile!" to your console.
## Security
Running commands from sources that you do not control is always a potential security risk. For this reason, we have added some checks when using remote Taskfiles:
1. When running a task from a remote Taskfile for the first time, Task will print a warning to the console asking you to check that you are sure that you trust the source of the Taskfile. If you do not accept the prompt, then Task will exit with code `104` (not trusted) and nothing will run. If you accept the prompt, the remote Taskfile will run and further calls to the remote Taskfile will not prompt you again.
2. Whenever you run a remote Taskfile, Task will create and store a checksum of the file that you are running. If the checksum changes, then Task will print another warning to the console to inform you that the contents of the remote file has changed. If you do not accept the prompt, then Task will exit with code `104` (not trusted) and nothing will run. If you accept the prompt, the checksum will be updated and the remote Taskfile will run.
Sometimes you need to run Task in an environment that does not have an interactive terminal, so you are not able to accept a prompt. In these cases you are able to tell task to accept these prompts automatically by using the `--yes` flag. Before enabling this flag, you should:
1. Be sure that you trust the source and contents of the remote Taskfile.
2. Consider using a pinned version of the remote Taskfile (e.g. A link containing a commit hash) to prevent Task from automatically accepting a prompt that says a remote Taskfile has changed.
Task currently supports both `http` and `https` URLs. However, the `http` requests will not execute by default unless you run the task with the `--insecure` flag. This is to protect you from accidentally running a remote Taskfile that is hosted on and unencrypted connection. Sources that are not protected by TLS are vulnerable to [man-in-the-middle attacks][man-in-the-middle-attacks] and should be avoided unless you know what you are doing.
## Caching & Running Offline
Whenever you run a remote Taskfile, the latest copy will be downloaded from the internet and cached locally. If for whatever reason, you lose access to the internet, you will still be able to run your tasks by specifying the `--offline` flag. This will tell Task to use the latest cached version of the file instead of trying to download it. You are able to use the `--download` flag to update the cached version of the remote files without running any tasks.
By default, Task will timeout requests to download remote files after 10 seconds and look for a cached copy instead. This timeout can be configured by setting the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will set the timeout to 5 seconds.
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[enabling-experiments]: /experiments/#enabling-experiments
[man-in-the-middle-attacks]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack

View File

@@ -0,0 +1,39 @@
---
#This is a template for an experiments documentation
#Copy this page and fill in the details as necessary
title: '--- Template ---'
sidebar_position: -1 #Always push to the top
draft: true #Hide in production
---
# \{Name of Experiment\} (#\{Issue\})
:::caution
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production environment. They are intended for testing and feedback only.
:::
:::warning
This experiment breaks the following functionality:
- \{list any existing functionality that will be broken by this experiment\}
- \{if there are no breaking changes, remove this admonition\}
:::
:::info
To enable this experiment, set the environment variable: `TASK_X_{feature}=1`. Check out [our guide to enabling experiments ][enabling-experiments] for more information.
:::
\{Short description of the feature\}
\{Short explanation of how users should migrate to the new behavior\}
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[enabling-experiments]: /experiments/#enabling-experiments

View File

@@ -0,0 +1,50 @@
---
slug: /experiments/workflow/
---
# Workflow
Experiments are a way for us to test out new features in Task before committing to them in a major release. Because this concept is built around the idea of feedback from our community, we have built a workflow for the process of introducing these changes. This ensures that experiments are given the attention and time that they need and that we are getting the best possible results out of them.
The sections below describe the various stages that an experiment must go through from its proposal all the way to being released in a major version of Task.
## 1. Proposal
All experimental features start with a proposal in the form of a GitHub issue. If the maintainers decide that an issue has enough support and is a breaking change or is complex/controversial enough to require user feedback, then the issue will be marked with the ![proposal][] label. At this point, the issue becomes a proposal and a period of consultation begins. During this period, we request that users provide feedback on the proposal and how it might effect their use of Task. It is up to the discretion of the maintainers to decide how long this period lasts.
## 2. Draft
Once a proposal's consultation ends, a contributor may pick up the work and begin the initial implementation. Once a PR is opened, the maintainers will ensure that it meets the requirements for an experimental feature (i.e. flags are in the right format etc) and merge the feature. Once this code is released, the status will be updated via the ![draft][] label. This indicates that an implementation is now available for use in a release and the experiment is open for feedback.
:::note
During the draft period, major changes to the implementation may be made based on the feedback received from users. There are _no stability guarantees_ and experimental features may be abandoned _at any time_.
:::
## 3. Candidate
Once an acceptable level of consensus has been reached by the community and feedback/changes are less frequent/significant, the status may be updated via the ![candidate][] label. This indicates that a proposal is _likely_ to accepted and will enter a period for final comments and minor changes.
## 4. Stable
Once a suitable amount of time has passed with no changes or feedback, an experiment will be given the ![stable][] label. At this point, the functionality will be treated like any other feature in Task and any changes _must_ be backward compatible. This allows users to migrate to the new functionality without having to worry about anything breaking in future releases. This provides the best experience for users migrating to a new major version.
## 5. Released
When making a new major release of Task, all experiments marked as ![stable][] will move to ![released][] and their behaviors will become the new default in Task. Experiments in an earlier stage (i.e. not stable) cannot be released and so will continue to be experiments in the new version.
## Abandoned / Superseded
If an experiment is unsuccessful at any point then it will be given the ![abandoned][] or ![superseded][] labels depending on which is more suitable. These experiments will be removed from Task.
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[proposal]: https://img.shields.io/badge/experiment:%20proposal-purple
[draft]: https://img.shields.io/badge/experiment:%20draft-purple
[candidate]: https://img.shields.io/badge/experiment:%20candidate-purple
[stable]: https://img.shields.io/badge/experiment:%20stable-purple
[released]: https://img.shields.io/badge/experiment:%20released-purple
[abandoned]: https://img.shields.io/badge/experiment:%20abandoned-purple
[superseded]: https://img.shields.io/badge/experiment:%20superseded-purple

View File

@@ -0,0 +1,89 @@
---
slug: /faq/
sidebar_position: 15
---
# FAQ
This page contains a list of frequently asked questions about Task.
## Why won't my task update my shell environment?
This is a limitation of how shells work. Task runs as a subprocess of your current shell, so it can't change the environment of the shell that started it. This limitation is shared by other task runners and build tools too.
A common way to work around this is to create a task that will generate output that can be parsed by your shell. For example, to set an environment variable on your shell you can write a task like this:
```yaml
my-shell-env:
cmds:
- echo "export FOO=foo"
- echo "export BAR=bar"
```
Now run `eval $(task my-shell-env)` and the variables `$FOO` and `$BAR` will be available in your shell.
## I can't reuse my shell in a task's commands
Task runs each command as a separate shell process, so something you do in one command won't effect any future commands. For example, this won't work:
```yaml
version: '3'
tasks:
foo:
cmds:
- a=foo
- echo $a
# outputs ""
```
To work around this you can either use a multiline command:
```yaml
version: '3'
tasks:
foo:
cmds:
- |
a=foo
echo $a
# outputs "foo"
```
Or for more complex multi-line commands it is recommended to move your code into a separate file and call that instead:
```yaml
version: '3'
tasks:
foo:
cmds:
- ./foo-printer.bash
```
```bash
#!/bin/bash
a=foo
echo $a
```
## 'x' builtin command doesn't work on Windows
The default shell on Windows (`cmd` and `powershell`) do not have commands like `rm` and `cp` available as builtins. This means that these commands won't work. If you want to make your Taskfile fully cross-platform, you'll need to work around this limitation using one of the following methods:
- Use the `{{OS}}` function to run an OS-specific script.
- Use something like `{{if eq OS "windows"}}powershell {{end}}<my_cmd>` to detect windows and run the command in Powershell directly.
- Use a shell on Windows that supports these commands as builtins, such as [Git Bash][git-bash] or [WSL][wsl].
We want to make improvements to this part of Task and the issues below track this work. Constructive comments and contributions are very welcome!
- #197
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[git-bash]: https://gitforwindows.org/
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/install

View File

@@ -0,0 +1,266 @@
---
slug: /installation/
sidebar_position: 2
---
# Installation
Task offers many installation methods. Check out the available methods below.
## Package Managers
### Homebrew
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting Task is as simple as running:
```bash
brew install go-task/tap/go-task
```
The above Formula is [maintained by ourselves](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb).
Recently, Task was also made available [on the official Homebrew repository](https://formulae.brew.sh/formula/go-task), so you also have that option if you prefer:
```bash
brew install go-task
```
### Tea
If you're on macOS or Linux and have [tea][tea] installed, getting Task is as simple as running:
```bash
tea task
```
or, if you have teas magic enabled:
```bash
task
```
This installation method is community owned. After a new release of Task, they are automatically released by tea in a minimum of time.
### Snap
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
```
### Chocolatey
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as simple as running:
```bash
choco install go-task
```
This installation method is community owned.
### Scoop
If you're on Windows and have [Scoop][scoop] installed, getting Task is as simple as running:
```cmd
scoop install task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available on Scoop.
### AUR
If you're on Arch Linux you can install Task from [AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite package manager such as `yay`, `pacaur` or `yaourt`:
```cmd
yay -S go-task-bin
```
Alternatively, there's [this package](https://aur.archlinux.org/packages/go-task) which installs from the source code instead of downloading the binary from the [releases page](https://github.com/go-task/task/releases):
```cmd
yay -S go-task
```
This installation method is community owned.
### Fedora
If you're on Fedora Linux you can install Task from the official [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/) repository using `dnf`:
```cmd
sudo dnf install go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
### Nix
If you're on NixOS or have Nix installed you can install Task from [nixpkgs](https://github.com/NixOS/nixpkgs):
```cmd
nix-env -iA nixpkgs.go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [nixpkgs](https://github.com/NixOS/nixpkgs).
### npm
You can also use Node and npm to install Task by installing [this package](https://www.npmjs.com/package/@go-task/cli).
```bash
npm install -g @go-task/cli
```
### Winget
If you are using Windows and installed the [winget](https://github.com/microsoft/winget-cli) package management tool, you can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
```bash
winget install Task.Task
```
## Get The Binary
### Binary
You can download the binary from the [releases page on GitHub][releases] and add to your `$PATH`.
DEB and RPM packages are also available.
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
### Install Script
We also have an [install script][installscript] which is very useful in scenarios like CI. Many thanks to [GoDownloader][godownloader] for enabling the easy generation of this script.
By default, it installs on the `./bin` directory relative to the working directory:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
```
It is possible to override the installation directory with the `-b` parameter. On Linux, common choices are `~/.local/bin` and `~/bin` to install for the current user or `/usr/local/bin` to install for all users:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
```
:::caution
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by default.
:::
### GitHub Actions
If you want to install Task in GitHub Actions you can try using [this action](https://github.com/arduino/setup-task) by the Arduino team:
```yaml
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
This installation method is community owned.
## Build From Source
### Go Modules
Ensure that you have a supported version of [Go][go] properly installed and setup. You can find the minimum required version of Go in the [go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
You can then install the latest release globally by running:
```bash
go install github.com/go-task/task/v3/cmd/task@latest
```
Or you can install into another directory:
```bash
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
```
:::tip
For CI environments we recommend using the [install script](#install-script) instead, which is faster and more stable, since it'll just download the latest released binary.
:::
## Setup completions
Download the autocompletion file corresponding to your shell.
[All completions are available on the Task repository](https://github.com/go-task/task/tree/main/completion).
### Bash
First, ensure that you installed bash-completion using your package manager.
Make the completion file executable:
```
chmod +x path/to/task.bash
```
After, add this to your `~/.bash_profile`:
```shell
source path/to/task.bash
```
### ZSH
Put the `_task` file somewhere in your `$FPATH`:
```shell
mv path/to/_task /usr/local/share/zsh/site-functions/_task
```
Ensure that the following is present in your `~/.zshrc`:
```shell
autoload -U compinit
compinit -i
```
ZSH version 5.7 or later is recommended.
### Fish
Move the `task.fish` completion script:
```shell
mv path/to/task.fish ~/.config/fish/completions/task.fish
```
### PowerShell
Open your profile script with:
```
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
notepad $profile
```
Add the line and save the file:
```shell
Invoke-Expression -Command path/to/task.ps1
```
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[go]: https://golang.org/
[snapcraft]: https://snapcraft.io/task
[homebrew]: https://brew.sh/
[installscript]: https://github.com/go-task/task/blob/main/install-task.sh
[releases]: https://github.com/go-task/task/releases
[godownloader]: https://github.com/goreleaser/godownloader
[choco]: https://chocolatey.org/
[scoop]: https://scoop.sh/
[tea]: https://tea.xyz/

View File

@@ -0,0 +1,62 @@
---
slug: /integrations/
sidebar_position: 8
---
# Integrations
## Visual Studio Code Extension
Task has an [official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task). El código de ese proyecto puede ser encontrado [aquí](https://github.com/go-task/vscode-task). Para usar la extensión es necesario tener instalada la versión v3.23.0+ de Task.
La extensión proporciona las siguientes funcionalidades (y más...):
- View tasks in the sidebar.
- Ejecuta tareas desde la barra lateral y la paleta de comandos.
- Go to definition from the sidebar and command palette.
- Run last task command.
- Multi-root workspace support.
- Initialize a Taskfile in the current workspace.
To get autocompletion and validation for your Taskfile, see the [Schema](#schema) section below.
![Task for Visual Studio Code](https://github.com/go-task/vscode-task/blob/main/res/preview.png?raw=true)
## Schema
This was initially created by @KROSF in [this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895) and is now officially maintained in [this file](https://github.com/go-task/task/blob/main/docs/static/schema.json) and made available at https://taskfile.dev/schema.json. This schema can be used to validate Taskfiles and provide autocompletion in many code editors:
### Visual Studio Code
To integrate the schema into VS Code, you need to install the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) by Red Hat. Any `Taskfile.yml` in your project should automatically be detected and validation/autocompletion should work. If this doesn't work or you want to manually configure it for files with a different name, you can add the following to your `settings.json`:
```json
// settings.json
{
"yaml.schemas": {
"https://taskfile.dev/schema.json": [
"**/Taskfile.yml",
"./path/to/any/other/taskfile.yml"
]
}
}
```
You can also configure the schema directly inside of a Taskfile by adding the following comment to the top of the file:
```yaml
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
```
You can find more information on this in the [YAML language server project](https://github.com/redhat-developer/yaml-language-server).
## Community Integrations
In addition to our official integrations, there is an amazing community of developers who have created their own integrations for Task:
- [Sublime Text Plugin](https://packagecontrol.io/packages/Taskfile) [[source](https://github.com/biozz/sublime-taskfile)] by @biozz
- [IntelliJ Plugin](https://plugins.jetbrains.com/plugin/17058-taskfile) [[source](https://github.com/lechuckroh/task-intellij-plugin)] by @lechuckroh
- [mk](https://github.com/pycontribs/mk) command line tool recognizes Taskfiles natively.
If you have made something that integrates with Task, please feel free to open a PR to add it to this list.

View File

@@ -0,0 +1,49 @@
---
slug: /
sidebar_position: 1
title: Home
---
# Task
<div align="center">
<img id="logo" src="img/logo.svg" height="250px" width="250px" />
</div>
Task is a task runner / build tool that aims to be simpler and easier to use than, for example, [GNU Make][make].
Since it's written in [Go][go], Task is just a single binary and has no other dependencies, which means you don't need to mess with any complicated install setups just to use a build tool.
Once [installed](/installation), you just need to describe your build tasks using a simple [YAML][yaml] schema in a file called `Taskfile.yml`:
```yaml title="Taskfile.yml"
version: '3'
tasks:
hello:
cmds:
- echo 'Hello World from Task!'
silent: true
```
And call it by running `task hello` from your terminal.
The above example is just the start, you can take a look at the [usage](/usage) guide to check the full schema documentation and Task features.
## Features
- [Easy installation](/installation): just download a single binary, add to `$PATH` and you're done! Or you can also install using [Homebrew][homebrew], [Snapcraft][snapcraft], or [Scoop][scoop] if you want.
- Available on CIs: by adding [this simple command](/installation#install-script) to install on your CI script and you're ready to use Task as part of your CI pipeline;
- Truly cross-platform: while most build tools only work well on Linux or macOS, Task also supports Windows thanks to [this shell interpreter for Go][sh].
- Great for code generation: you can easily [prevent a task from running](/usage#prevent-unnecessary-work) if a given set of files haven't changed since last run (based either on its timestamp or content).
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[make]: https://www.gnu.org/software/make/
[go]: https://go.dev/
[yaml]: http://yaml.org/
[homebrew]: https://brew.sh/
[snapcraft]: https://snapcraft.io/
[scoop]: https://scoop.sh/
[sh]: https://github.com/mvdan/sh

View File

@@ -0,0 +1,50 @@
---
slug: /releasing/
sidebar_position: 13
---
# Releasing
The release process of Task is done with the help of [GoReleaser][goreleaser]. You can test the release process locally by calling the `test-release` task of the Taskfile.
[GitHub Actions](https://github.com/go-task/task/actions) should release artifacts automatically when a new Git tag is pushed to `main` branch (raw executables and DEB and RPM packages).
Since v3.15.0, raw executables can also be reproduced and verified locally by checking out a specific tag and calling `goreleaser build`, using the Go version defined in the above GitHub Actions.
# Homebrew
Goreleaser will automatically push a new commit to the [Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap] repository to release the new version.
# npm
To release to npm update the version in the [`package.json`][packagejson] file and then run `task npm:publish` to push it.
# Snapcraft
The [snap package][snappackage] requires to manual steps to release a new version:
- Updating the current version on [snapcraft.yaml][snapcraftyaml].
- Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on the [Snapcraft dashboard][snapcraftdashboard].
# winget
winget also requires manual steps to be completed. By running `task goreleaser:test` locally, manifest files will be generated on `dist/winget/manifests/t/Task/Task/v{version}`. [Upload the manifest directory into this fork](https://github.com/go-task/winget-pkgs/tree/master/manifests/t/Task/Task) and open a pull request into [this repository](https://github.com/microsoft/winget-pkgs).
# Scoop
Scoop is a command-line package manager for the Windows operating system. Scoop package manifests are maintained by the community. Scoop owners usually take care of updating versions there by editing [this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json). If you think its Task version is outdated, open an issue to let us know.
# Nix
Nix is a community owned installation method. Nix package maintainers usually take care of updating versions there by editing [this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/go-task/default.nix). If you think its Task version is outdated, open an issue to let us know.
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[goreleaser]: https://goreleaser.com/
[homebrewtap]: https://github.com/go-task/homebrew-tap
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
[snappackage]: https://github.com/go-task/snap
[snapcraftyaml]: https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
[snapcraftdashboard]: https://snapcraft.io/task/releases

View File

@@ -0,0 +1,220 @@
---
slug: /styleguide/
sidebar_position: 10
---
# Styleguide
This is the official Task styleguide for `Taskfile.yml` files. This guide contains some basic instructions to keep your Taskfile clean and familiar to other users.
This contains general guidelines, but they don't necessarily need to be strictly followed. Feel free to disagree and proceed differently at some point if you need or want to. Also, feel free to open issues or pull requests with improvements to this guide.
## Use the correct order of keywords
- `version:`
- `includes:`
- Configuration ones, like `output:`, `silent:`, `method:` and `run:`
- `vars:`
- `env:`, `dotenv:`
- `tasks:`
## Use 2 spaces for indentation
This is the most common convention for YAML files, and Task follows it.
```yaml
# bad
tasks:
foo:
cmds:
- echo 'foo'
# good
tasks:
foo:
cmds:
- echo 'foo'
```
## Separate with spaces the mains sections
```yaml
# bad
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
# good
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
```
## Add spaces between tasks
```yaml
# bad
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
# good
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
```
## Use upper-case variable names
```yaml
# bad
version: '3'
vars:
binary_name: myapp
tasks:
build:
cmds:
- go build -o {{.binary_name}} .
# good
version: '3'
vars:
BINARY_NAME: myapp
tasks:
build:
cmds:
- go build -o {{.BINARY_NAME}} .
```
## Don't wrap vars in spaces when templating
```yaml
# bad
version: '3'
tasks:
greet:
cmds:
- echo '{{ .MESSAGE }}'
# good
version: '3'
tasks:
greet:
cmds:
- echo '{{.MESSAGE}}'
```
This convention is also used by most people for any Go templating.
## Separate task name words with a dash
```yaml
# bad
version: '3'
tasks:
do_something_fancy:
cmds:
- echo 'Do something'
# good
version: '3'
tasks:
do-something-fancy:
cmds:
- echo 'Do something'
```
## Use colon for task namespacing
```yaml
# good
version: '3'
tasks:
docker:build:
cmds:
- docker ...
docker:run:
cmds:
- docker-compose ...
```
This is also done automatically when using included Taskfiles.
## Prefer external scripts over complex multi-line commands
```yaml
# bad
version: '3'
tasks:
build:
cmds:
- |
for i in $(seq 1 10); do
echo $i
echo "some other complex logic"
done'
# good
version: '3'
tasks:
build:
cmds:
- ./scripts/my_complex_script.sh
```

View File

@@ -0,0 +1,240 @@
---
slug: /taskfile-versions/
sidebar_position: 5
---
# Taskfile Versions
The Taskfile syntax and features changed with time. This document explains what changed on each version and how to upgrade your Taskfile.
## What the Taskfile version mean
The Taskfile version follows the Task version. E.g. the change to Taskfile version `2` means that Task `v2.0.0` should be release to support it.
The `version:` key on Taskfile accepts a semver string, so either `2`, `2.0` or `2.0.0` is accepted. If you choose to use `2.0` Task will not enable future `2.1` features, but if you choose to use `2`, then any `2.x.x` features will be available, but not `3.0.0+`.
## Version 3 ![latest](https://img.shields.io/badge/latest-brightgreen)
These are some major changes done on `v3`:
- Task's output will now be colored
- Added support for `.env` like files
- Added `label:` setting to task so one can override how the task name appear in the logs
- A global `method:` was added to allow setting the default method, and Task's default changed to `checksum`
- Two magic variables were added when using `status:`: `CHECKSUM` and `TIMESTAMP` which contains, respectively, the XXH3 checksum and greatest modification timestamp of the files listed on `sources:`
- Also, the `TASK` variable is always available with the current task name
- CLI variables are always treated as global variables
- Added `dir:` option to `includes` to allow choosing on which directory an included Taskfile will run:
```yaml
includes:
docs:
taskfile: ./docs
dir: ./docs
```
- Implemented short task syntax. All below syntaxes are equivalent:
```yaml
version: '3'
tasks:
print:
cmds:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print: echo "Hello, World!"
```
- There was a major refactor on how variables are handled. They're now easier to understand. The `expansions:` setting was removed as it became unnecessary. This is the order in which Task will process variables, each level can see the variables set by the previous one and override those.
- Environment variables
- Global + CLI variables
- Call variables
- Task variables
## Version 2.6
:::caution
v2 schemas are [no longer supported by the latest version of Task][deprecate-version-2-schema].
:::
Version 2.6 comes with `preconditions` stanza in tasks.
```yaml
version: '2'
tasks:
upload_environment:
preconditions:
- test -f .env
cmds:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation][includes]
## Version 2.2
:::caution
v2 schemas are [no longer supported by the latest version of Task][deprecate-version-2-schema].
:::
Version 2.2 comes with a global `includes` options to include other Taskfiles:
```yaml
version: '2'
includes:
docs: ./documentation # will look for ./documentation/Taskfile.yml
docker: ./DockerTasks.yml
```
## Version 2.1
:::caution
v2 schemas are [no longer supported by the latest version of Task][deprecate-version-2-schema].
:::
Version 2.1 includes a global `output` option, to allow having more control over how commands output are printed to the console (see [documentation][output] for more info):
```yaml
version: '2'
output: prefixed
tasks:
server:
cmds:
- go run main.go
prefix: server
```
From this version it's also possible to ignore errors of a command or task (check documentation [here][ignore_errors]):
```yaml
version: '2'
tasks:
example-1:
cmds:
- cmd: exit 1
ignore_error: true
- echo "This will be print"
example-2:
cmds:
- exit 1
- echo "This will be print"
ignore_error: true
```
## Version 2.0
:::caution
v2 schemas are [no longer supported by the latest version of Task][deprecate-version-2-schema].
:::
At version 2, we introduced the `version:` key, to allow us to evolve Task with new features without breaking existing Taskfiles. The new syntax is as follows:
```yaml
version: '2'
tasks:
echo:
cmds:
- echo "Hello, World!"
```
Version 2 allows you to write global variables directly in the Taskfile, if you don't want to create a `Taskvars.yml`:
```yaml
version: '2'
vars:
GREETING: Hello, World!
tasks:
greet:
cmds:
- echo "{{.GREETING}}"
```
The variable priority order changed to the following:
1. Task variables
2. Call variables
3. Taskfile variables
4. Taskvars file variables
5. Environment variables
A new global option was added to configure the number of variables expansions (which default to 2):
```yaml
version: '2'
expansions: 3
vars:
FOO: foo
BAR: bar
BAZ: baz
FOOBAR: '{{.FOO}}{{.BAR}}'
FOOBARBAZ: '{{.FOOBAR}}{{.BAZ}}'
tasks:
default:
cmds:
- echo "{{.FOOBARBAZ}}"
```
## Version 1
:::caution
v1 schema support was removed in Task >= v3.0.0.
:::
In the first version of the `Taskfile`, the `version:` key was not available, because the tasks was in the root of the YAML document. Like this:
```yaml
echo:
cmds:
- echo "Hello, World!"
```
The variable priority order was also different:
1. Call variables
2. Environment
3. Task variables
4. `Taskvars.yml` variables
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[deprecate-version-2-schema]: /deprecations/version-2-schema/
[output]: /usage#output-syntax
[ignore_errors]: /usage#ignore-errors
[includes]: /usage#including-other-taskfiles

View File

@@ -0,0 +1,18 @@
---
slug: /translate/
sidebar_position: 12
---
# Translate
Want to help us translate this documentation? In this document we explain how.
Do NOT edit translated markdown files directly on the GitHub repository! We use [Crowdin][crowdin] to allow contributors on work on translations. The repository is periodically updated with progress from Crowdin.
If you want to have access to the Crowdin project to be able to suggest translations, please ask for access on the [#translations channel on our Discord server][discord]. If a given language is not being shown to Crowdin yet, just ask and we can configure it.
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
[crowdin]: https://crowdin.com/project/taskfile
[discord]: https://discord.gg/6TY36E39UK

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More