worktree: harden the add prefix check and widen the self-test
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Read src/taskfile-include-worktree.yaml and tests/worktree-selftest.sh; the issue lists the module changes and self-test cases. Start by running the self-test and checking how its Taskfile invokes add, including through an includes: wrapper. Done when the prefix checks and messages are hardened, all listed negative cases and wrapper invocation are covered, and the tests work with portable branch setup.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up from the review of #52 (fix for #50). None of these block #52; they reduce the chance the same class of defect comes back.
Module (src/taskfile-include-worktree.yaml, add)
- Replace the prefix loop with a single
case " $allowed_prefixes " in *" $prefix "*) … esactest, so no loop exit status can leak underset -ein go-task's mvdan/sh. - Check
[ "$prefix" != "$branch" ](branch has a/) once, before the prefix test, and give it its own message ("branch lacks a prefix" vs. "prefix not allowed").
Self-test (tests/worktree-selftest.sh)
- The
sedthat readsWORKTREE_ALLOWED_PREFIXESonly handles a plain literal. When the module is converted to the'{{.NAME | default "…"}}'form CLAUDE.md requires, it exits 2 ("Could not read…"). Read the resolved value instead, or handle both forms. - Exercise the module through an
includes:wrapper Taskfile (as consumers do) in addition totask -t <module> add. - Add negative cases for the slug guard (
*/*,*..*), "Destination already exists", and the usage exit code (2). git init -b developneeds git ≥ 2.28; usegit init+git symbolic-ref HEAD refs/heads/developfor portability.
- Lingua principale
- Shell
- Stelle
- 0
- Fork
- 0
- Merge medio
- 11m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nolte/taskfiles
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
-
worktree:add: quote CLI args and derive repo name from the fetch remoteForse già presa @nolte l’ha presa 11 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Tutte le issue di nolte/taskfiles
Issue simili
-
Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
PowerShell/PowerShell#28432 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nolte/kamerplanter-appliance#32 ·
I maintainer di solito rispondono entro 1 giorno
-
research
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
slayerlabs/benchmarks-fabryka-ai#256 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100