Commit Graph

2876 Commits

Author SHA1 Message Date
Valentin Maerten
a9bf2c8020 refactor(completion): move the shell test harness out of completion/
Packaging globs completion/ into the release archives, so the harness
added alongside the engine was about to ship run.sh and five wrapper
scripts to every user. The previous commit worked around it by listing
the packaged directories one by one, which quietly stops packaging any
shell added later.

Moving the harness to testdata/completion/ leaves completion/ holding
only what we ship, so the glob can go back to completion/**/* and needs
no maintenance when a shell is added.
2026-08-29 11:05:08 +02:00
Valentin Maerten
b782d18a45 feat(completion): make the engine the default behind --completion
The engine shipped opt-in behind --new-completion, with the old scripts
still on --completion. That split was never released, so flip it now
rather than carry a third flag through a deprecation later.

--completion serves the engine wrappers; the hand-written scripts move to
completion/legacy/ and stay reachable via --legacy-completion for a
release or two.

.goreleaser.yml needed to follow: it packages the static files from
completion/ into the deb/rpm/apk contents and the Homebrew cask, so
leaving it untouched would have shipped the engine to anyone running
`eval "$(task --completion zsh)"` and the old scripts to everyone
installing from a package. The paths it references are unchanged and now
resolve to the wrappers. Its archive glob is narrowed at the same time,
so the test harness under completion/tests/ stops being shipped in the
release archives.
2026-08-29 10:55:16 +02:00
Valentin Maerten
13f72a0b56 fix(completion): always leave a trailing space after a task name
The protocol carries one directive per response, so a single truncated wildcard prefix cost every complete name its trailing space: a Taskfile holding `deploy-*` anywhere made `task buil<TAB>` insert `build` with the cursor stuck against it. Completing a task name is the common case and the wildcard prefix the rare one, so the polarity was backwards — and the legacy wrappers, which had no notion of an incomplete candidate, always left the space.

A wildcard prefix now gets a space it does not want, which is the accepted trade until suggestions can carry a directive of their own. Required variables keep NoSpace: there a free-form `VAR=` is the common case, not the exception.
2026-08-20 16:51:59 +02:00
Valentin Maerten
978277273e fix(completion): complete task names and required vars together
CLI variables are global to the invocation, not scoped to a task: `args.Parse` turns every word holding `=` into a global and every other word into a call, so `task build ENV=dev deploy` and `task build deploy ENV=dev` are the same command. The engine assumed the opposite and, as soon as a word matched a task, served only that task's variables — nothing at all when it had none. `task build <TAB>` and even `task build de<TAB>` went silent, where all five legacy wrappers offered task names at every position.

The engine now unions the still-unset requirements of every task named on the line, and falls through to task names once they are all set. The line resolves itself: fill in what blocks execution, then add another task. Keeping the two families exclusive means each keeps a coherent directive, so nothing loses its trailing space.

Task words are matched with FindMatchingTasks instead of a hand-built list of names truncated at their first `*`, which is why `task wildcard-foo <TAB>` used to offer task names rather than the variables of `wildcard-*`. Completion also disables fuzzy matching: a suggestion list has no "did you mean".

Three fixes ride along. `--sort default` left the sorter nil and cleared the one NewExecutor had set, so completion listed tasks in Taskfile order while `--list` sorted them — and a single templated description silently restored the sort through GetTaskList. The bash wrapper never defined KeepOrder, losing the declaration order of `requires`; it now passes `compopt -o nosort`, which bash 3.2 ignores as it already ignores nospace. And the shell suite unsets TASK_EXE and GO_TASK_PROGNAME: fish, Nushell and PowerShell resolve the binary through them, so an ambient value silently tested something other than the binary just built.
2026-08-20 16:11:49 +02:00
Valentin Maerten
5fe752d48a refactor(completion): tighten the engine after a cleanup pass
`--temp-dir` was missing from the flag-to-directive map, so it fell back to plain file completion while `--dir` and `--remote-cache-dir` offered directories.

The rest is dead weight: `listTasks` re-defaulted a sorter `NewExecutor` already sets and scanned descriptions for templates even with `--no-descriptions`; `detectTaskName` had a `--` branch `Complete` returns before reaching; the two flag-value branches built the same suggestion slice twice. `os.Args[2:]` is now sliced in one place, `complete.Words()`, instead of three, and the test helpers reuse `slicesext.Convert`.
2026-08-20 15:12:47 +02:00
Valentin Maerten
b00d2bafb6 test(completion): drop the binary-building protocol tests
completion/protocol_test.go built a `task` binary in TestMain and drove it through 21 subprocess spawns. Every one of its table cases already had a one-for-one in-process equivalent in internal/complete, and the wire format is asserted by TestWrite_Format.

The one guarantee worth keeping was the `-t -` guard, which stops a keystroke from blocking on a Taskfile read from the terminal. It moves from cmd/task into complete.NeedsTaskfile, where it reads the flagset instead of the flags package global — testable in-process, and one less global read in cmd/task.

TestCompletionShells moves to internal/complete unchanged, and the in-process wildcard fixture gains `matches-exactly-*`, the only pattern of testdata/wildcards it was missing.

The binary path stays covered end to end by completion/tests/run.sh, which the CI completion job runs against five real shells on Linux and macOS.
2026-08-20 14:50:45 +02:00
Valentin Maerten
960fdb7bc5 docs(completion): document the new engine in next/, not latest/
The `--new-completion` section landed in website/src/latest/, which only release commits write to. Moved verbatim to website/src/next/, where the two files were byte-identical up to that point.
2026-08-20 14:28:16 +02:00
Valentin Maerten
ed7a206e19 feat(completion): unify shell completions behind an opt-in task __complete engine
Bash, Fish, Zsh, Nushell and PowerShell now share a single backend: `task __complete` returns the suggestions plus a directive, and every wrapper is a thin shim around it. All five shells offer the same suggestions — task names, aliases, flags, flag values and per-task CLI variables. The Zsh `show-aliases` and `verbose` zstyles keep working, now backed by the `--no-aliases` and `--no-descriptions` completion flags.

The engine is opt-in via `task --new-completion <shell>`, leaving `--completion` and the legacy scripts untouched; it will become the default in a future release. The new wrappers live under `completion/next/`.

Completing a keystroke never reaches the network, never blocks on a stdin entrypoint, and honors every flag that decides how the Taskfile is loaded. Ref resolution shared by `requires` and enum completion moved to `internal/refs`.

A cross-shell test suite exercises the protocol in Go with thin shell smoke tests, and runs in CI.
2026-08-20 14:18:54 +02:00
Valentin Maerten
dd4463ec60 chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920) 2026-08-20 12:24:04 +02:00
Valentin Maerten
325e3188f0 chore(deps): update golangci-lint to 2.13.0 (#2991) 2026-08-20 12:24:03 +02:00
Valentin Maerten
6170794c9f chore: re-write changelog for 3.53.1 2026-08-18 18:08:21 +02:00
Valentin Maerten
ff3372fc50 v3.53.1 v3.53.1 2026-08-18 17:23:38 +02:00
Valentin Maerten
beed208fd3 fix(ci): run pnpm install from the website directory 2026-08-18 17:20:25 +02:00
Valentin Maerten
3ae5b31b90 chore: remove accidentally committed worktree gitlink 2026-08-18 17:16:46 +02:00
Valentin Maerten
1530114bca v3.53.0 v3.53.0 2026-08-18 17:14:13 +02:00
Valentin Maerten
2449247e16 feat(homebrew): migrate from Formula to Cask (#2702) 2026-08-18 17:11:28 +02:00
Valentin Maerten
ed98857afc docs: credit JetBrains for the open source licenses (#2984) 2026-08-18 17:00:39 +02:00
Pete Davison
4bcc01fb1e feat: add blog post for remote taskfiles (#2974) 2026-08-18 16:59:59 +02:00
renovate[bot]
d9d0e44cf4 chore(deps): update all non-major dependencies (#2978)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2026-08-18 16:58:43 +02:00
Valentin Maerten
936b90c625 feat(website): serve the released docs from a versioned copy (#2979) 2026-08-17 14:15:03 +02:00
Pete Davison
b7836eb893 feat: set content type for example remote taskfile 2026-08-16 11:46:30 +00:00
Pete Davison
c1a804e0bc chore: changelog for #2981 2026-08-16 11:32:28 +00:00
Pete Davison
1d0719b65a feat: load the sidebar data and titles/excerpts from the blog post markdown document and its frontmatter (#2981) 2026-08-16 12:14:08 +01:00
Valentin Maerten
1868ad2969 fix(remote): verify the pinned checksum on remote cache hits (#2980) 2026-08-14 19:46:08 +02:00
Pete Davison
50c5ae18e4 fix: minor adjustment to blog post description to match post edit 2026-08-13 21:49:48 +00:00
Pete Davison
908c6b96da feat: update pull request template (#2975) 2026-08-13 18:05:29 +01:00
Andrey Nering
4c144fed8f chore(website): add blog post about the github secure oss fund (#2977)
Co-authored-by: Pete Davison <pd93.uk@outlook.com>
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2026-08-13 13:18:56 -03:00
Valentin Maerten
813bc8a11d chore: drop the breaking-change marker from the #2898 changelog entry 2026-08-13 16:01:18 +02:00
Valentin Maerten
695df18231 fix(completion): drop the REMOTE_TASKFILES marker from the Nushell flags (#2973) 2026-08-13 16:00:46 +02:00
Pete Davison
9491f1683c chore: add changelog for #2906 2026-08-13 13:51:02 +00:00
Pete Davison
87076b165f feat: enable remote taskfiles (#2906) 2026-08-13 14:38:10 +01:00
Valentin Maerten
37898d9102 feat: command timeouts (#2898) 2026-08-11 22:09:25 +02:00
Valentin Maerten
993508c782 feat(completion): add Nushell completions (#2966) 2026-08-11 20:12:17 +02:00
Valentin Maerten
e8404ea6e0 chore: changelog for #2942 2026-08-11 08:48:45 +02:00
Anil Natha
5e6b365fe8 fix: resolved escape key presses not canceling prompt for required vars (#2942)
Co-authored-by: Anil Natha <anilnatha@AnilsMacStudio.lan>
2026-08-11 08:47:21 +02:00
Andrei Bodrov
49e929d353 feat: Improve verbose logging - print failed task (#2240) 2026-08-10 22:52:08 +02:00
Valentin Maerten
bc37f113f1 chore: changelog for #2240 2026-08-10 22:51:54 +02:00
Valentin Maerten
8e89cf879c chore: changelog for #2967 2026-08-10 20:30:33 +02:00
Valentin Maerten
2ea5d7dee2 chore: changelog for #2044 2026-08-10 20:30:32 +02:00
Valentin Maerten
65471a2ef8 fix: align command schema definitions with the parser (#2967) 2026-08-10 20:25:05 +02:00
Gerard O'Keefe
49eea5352c fix: schema does not allow ignore_error in a for loop (#2044)
Co-authored-by: O'Keefe, Gerard (Gerry) <gokeefe@atb.com>
2026-08-10 18:22:25 +00:00
Valentin Maerten
2cdadb4c99 chore: changelog for #2956 2026-08-10 19:50:50 +02:00
shaurya
85aca587b1 fix: accept []string and []int in matrix refs (#2956)
Co-authored-by: no-hup <shauryaj.finance@gmail.com>
2026-08-10 19:47:58 +02:00
Nithwin
d4fd591dd3 docs: fix incorrect godoc comments on WithVersionCheck and WithFailfast (#2963) 2026-08-10 17:45:37 +00:00
renovate[bot]
a80bee87cb chore(deps): update all non-major dependencies (#2943) 2026-08-10 16:39:06 +02:00
Valentin Maerten
678bd6ba62 chore: changelog for #2959 2026-08-10 16:27:19 +02:00
星尘
2888867c94 feat: support excluding task namespaces (#2959) 2026-08-10 16:23:51 +02:00
Valentin Maerten
fc49c72647 refactor: centralize fingerprint method resolution in a Fingerprinter (#2924) 2026-08-10 16:12:18 +02:00
cui fliter
d2b02e3c69 fix: preserve stdin taskfile bytes (#2950)
Signed-off-by: cuishuang <imcusg@gmail.com>
2026-08-09 18:55:17 +00:00
shaurya
f174912975 docs: document use_gitignore in schema reference and guide (#2957)
Co-authored-by: no-hup <shauryaj.finance@gmail.com>
2026-08-05 10:48:23 +02:00