1
0
mirror of https://github.com/go-task/task.git synced 2025-06-02 23:27:37 +02:00

316 Commits

Author SHA1 Message Date
Timothy Rule
532644d7f8
feat: create NoSort sorter for CLI sort option "none" (#2125) 2025-03-16 13:17:14 +00:00
Pete Davison
ffeb3bcc3f
refactor: executor functional options (#2085)
* refactor: executor functional options

* refactor: minor tidy up of list code

* fix: WithVersionCheck missing from call to NewExecutor

* feat: docstrings for structs with functional options

* refactor: prefix the functional options with the name of the struct they belong to
2025-03-10 20:38:25 +00:00
Pete Davison
fb631902ce
refactor: run task through modernize tool (#2088) 2025-02-24 11:59:50 +00:00
Pete Davison
60c8ee0ce6
refactor: ast.Call should be in main task package (#2084) 2025-02-23 18:30:42 +00:00
Valentin Maerten
461714a899
feat: add a new .taskrc.yml to enable experiments (#1982) 2025-02-23 10:51:59 +01:00
Pete Davison
daf39a04bf
feat: iterators (#1798)
* feat: update to github.com/elliotchance/orderedmap/v3

* refactor: better sort package

* feat: iterators

* chore: remove unnecessary code
2025-02-22 16:22:03 +00:00
Pete Davison
ce96447468
chore: bump minimum version to 1.23 (#2059)
* chore: bump minimum version to 1.23

* fix: version package for 1.24

* feat: update golangci-lint version
2025-02-11 22:43:17 +00:00
Henrique Corrêa
0e23404d23
feat: specify --init filename/path (#2018)
* feat: specify init filename with --taskfile flag

previously, it was not possible to specify which filename to use when initializing a new Taskfile as it was hardcoded as "Taskfile.yml".

now the --taskfile flag specifies where to write the file to, and the first * contained in it will be replaced by "Taskfile", so `task -it *.yaml` will create a `Taskfile.yaml` file.

* docs: update CLI reference

* fix Flags header being inside tip admonition
* change -t flag's default column and add a description
* add Default Filenames section

* docs: revert adding Default Filenames section

I didn't realize it already existed elsewhere.

* refactor: use path instead of filepath on InitTaskFile

as requested to prevent ambiguity with the stdlib package.

* fix TestInit (incorrectly merged)

* docs: remove outdated info on --taskfile flag

* refactor task initialization changes

- remove const DefaultTaskInitFilename from taskfile/taskfile.go
- revert description of Entrypoint flag
- make InitTaskfile accept a path to either a file or a directory, and join the default Taskfile name+ext to it if it is a directory
- take the target file path from the first argument instead of the Entrypoint flag
- detect extension-only filenames (".yaml") instead of replacing "*" with "Taskfile"
- use different format in success log so that it makes sense at different paths than the current dir

* print colon instead of "at"

it's a lot cleaner in most cases.

* rewrite init tests

test both initializing to a directory path and a file path

* return final path from InitTaskfile

...and print it's relative representation

* fix lint error (ineffassign)

* use filepathext.TryAbsToRel() instead

* define and use filepathext.IsExtOnly()

* link to default filenames list in cli ref docs

(specifically in the --taskfile flag description)
2025-02-10 11:22:49 +00:00
Pete Davison
6ce798e16c
feat: experiments logging improvements (#2049)
* feat: warn when enabling inactive experiments

* feat: TASK_ environment prefix

* feat: calculate experiment enabled/active instead of storing

* refactor: rename GetTaskVar to GetTaskEnv

* feat: experiments tests
2025-02-08 23:02:51 +00:00
rohm1
24a830e384
fix: forward env to RunCommand when evaluating sh vars (#1869)
* forward env to RunCommand when evaluating sh vars. fixes #1742

* feat: added tests

* fix: test

---------

Co-authored-by: Pete Davison <pd93.uk@outlook.com>
2025-01-02 20:07:25 +00:00
Pete Davison
8ce9bdc8c7
refactor: remove pointer from prefixed mutex 2024-12-30 18:03:29 +00:00
Graham Dennis
0409c3c3ba
fix: concurrent mutations to prefixWriter (#1974) 2024-12-30 18:02:34 +00:00
Pete Davison
fd3532812e
fix: orderedmap race condition (#1972) 2024-12-30 17:58:45 +00:00
Pete Davison
2965841eb7
feat: use external package for ordered maps (#1797) 2024-12-30 17:54:36 +00:00
Valentin Maerten
9d8c4ba7e6
feat: add TASK_DIR special variable (#1961)
Co-authored-by: Pete Davison <pd93.uk@outlook.com>
2024-12-30 11:45:25 +01:00
christiandins
4dffab2e0a
feat: add parallel test execution to improve runtime (#1882) 2024-12-11 21:47:10 -03:00
mgbowman
2b54b04cfc
fix: dynamic variable output in verbose mode (#1921)
Co-authored-by: Matthew Bowman <mbowman@nvidia.com>
2024-12-07 16:05:53 +01:00
Oleksandr Redko
bc844246d4
chore: allow using only github.com/go-task/task/v3/errors package (#1926) 2024-11-30 12:00:58 -03:00
Oleksandr Redko
390220ec9c
fix: typos in docs, changelog, testdata, comments (#1910) 2024-11-07 13:25:59 -03:00
Pete Davison
148b090d8e
fix: bug where non-nil, empty dynamic variables are returned as an empty interface (#1904) 2024-11-04 13:30:39 +00:00
Norbert Hauriel
28a96d1427
docs(flags.go): flag description typo (#1905) 2024-11-04 12:58:48 +00:00
Amogh Rameshappa Devapura
c381923d3e
feat: add numCPU func (#1890) 2024-10-29 14:50:17 +01:00
Valentin Maerten
e078261f12
fix: special variables are defined with dotenv at task level (#1810) 2024-10-09 03:14:23 -04:00
George Rawlinson
460e587c66
fix: checksum override when passed via ldflags (#1830) 2024-09-23 13:45:41 -04:00
Valentin Maerten
ddccd1bb61
feat: add TASK_OFFLINE env and expose it as a special variable (#1716)
Co-authored-by: Pete Davison <pd93.uk@outlook.com>
2024-09-21 11:17:15 -04:00
Valentin Maerten
15aa4b86af
fix: double help is printed when --help is provided (#1806) 2024-09-14 05:16:47 -04:00
Pete Davison
3747b2ab7f
feat: completion command (#1157) 2024-09-02 19:21:53 +00:00
Daniel Story
045d054a5f
feat: add ALIAS special var (#1764) 2024-08-24 21:50:45 -03:00
Andrey Nering
b259edeb65
feat(defer): expose EXIT_CODE special variable to defer: (#1762)
Co-authored-by: Dor Sahar <dorsahar@icloud.com>
2024-08-14 22:53:14 -03:00
Pete Davison
5e9851f42f
Update minimum go version (#1758)
* feat: update minimum version to 1.22

* refactor: use int range iterator

* refactor: loop variables

* refactor: replace slicesext.FirstNonZero with cmp.Or

* refactor: use slices.Concat instead of append

* fix: unused param

* fix: linting
2024-08-14 08:37:05 -05:00
Valentin Maerten
4b6c79aca5
feat: experiment taskfile envs take precedence over os envs (#1633)
* feat: experiment taskfile envs take precedence over os envs

* fix test

* fix typo

Co-authored-by: Andrey Nering <andrey@nering.com.br>

* docs: add p about default

---------

Co-authored-by: Andrey Nering <andrey@nering.com.br>
2024-07-16 23:44:34 +01:00
Valentin Maerten
9ee4f21d62
fix: --version when a version is provided with -ldflags (#1711) 2024-07-05 14:53:36 -03:00
Valentin Maerten
375106c988
fix: list-task with multiline desc (#1656)
* fix: list-task with multiline desc

* feat: display all lines aligned  in a table

* fix: display experiments

* use ladicle/tabwrite to handle color

* delete empty lines

Co-authored-by: Andrey Nering <andrey@nering.com.br>

* remove all /n and replace by space

---------

Co-authored-by: Andrey Nering <andrey@nering.com.br>
2024-06-28 17:59:46 +01:00
Valentin Maerten
76030c9146
feat(remote): add a command to clear the cache (#1639)
* feat(remote): add a command to clear the cache

* Update cmd/task/task.go

Co-authored-by: Andrey Nering <andrey@nering.com.br>

* rebase

---------

Co-authored-by: Andrey Nering <andrey@nering.com.br>
2024-06-28 17:42:16 +01:00
Pete Davison
3aaa3223a0
fix: run once in shared dependencies (#1655)
* fix: run once in shared dependencies

* feat: add test
2024-06-28 16:50:02 +01:00
Pete Davison
ea85909e8b
chore: update deps 2024-06-09 20:30:43 +00:00
Alexander Arvidsson
856ba3b8c2
feat: colorize tasks in prefixed output (#1572)
* feat: Colorize tasks in prefixed output

* chore: comment and style changes

* fix code tag has spaces in api reference

* fix: migrate to use logger for colors

* fix: Add bright colors to the color sequence

* fix: make colorized prefix logger standard
2024-06-03 10:37:24 +01:00
Valentin Maerten
1e25ceab29
fix: version check (#1663)
* fix: version check

* refactor following review
2024-05-20 21:48:05 +01:00
Pete Davison
a3fce1c302
feat: variable references (#1654)
* feat: add references to the base code instead of the maps experiment

* feat: add template functions to ref resolver

* feat: tests

* docs: variable references

* feat: remove json and yaml keys from map variable experiment

* chore: typo
2024-05-16 16:20:59 +01:00
Pete Davison
252d549e3f
feat: task executable variable (#1624) 2024-05-15 21:50:18 -03:00
Pete Davison
fb3c64c46e fix: prompt response should go on same line as message 2024-05-15 21:32:33 -03:00
Andrey Nering
bfc9d7847d fix: add changelog + fix for booleans for #1641 2024-05-09 11:21:12 -03:00
Valentin Maerten
3397f2855f
fix: handle int and float env variable by converting them to string (#1641) 2024-05-09 11:14:38 -03:00
Pete Davison
ddd9964db7
feat: warn about move from any variables to map variables (#1618) 2024-04-24 21:40:52 +01:00
Pete Davison
630e58767b
feat: ability to resolve refs using templating syntax (#1612)
* feat: resolve references using templating syntax

* refactor: moved when references are resolved to one place

* fix: linter

* docs: update map variables doc
2024-04-24 19:47:24 +00:00
Tim Vergenz
16070c7a24
feat: add alias q for template function shellQuote (#1603)
Resolves #1601
2024-04-23 22:47:40 -03:00
Pete Davison
1ff618cc17
feat: enable any variables without maps (#1547)
* feat: enable any variable experiment (without maps)

* chore: rename any_variables experiment to map_variables

* docs: create map variables experiment docs and update usage

* blog: any variables

* fix: links

* fix: warn about broken links instead of failing
2024-04-09 12:14:14 +01:00
Andrey Nering
eb2783fcce
fix: fix bug for files with special chars &() (#1584) 2024-04-09 02:08:30 +00:00
Pete Davison
454fe65ef3
feat: support 8-bit color (#1576) 2024-04-08 21:49:44 -03:00
Pete Davison
cbc19d35ea feat: root remote taskfiles 2024-03-25 19:13:27 +00:00