use shellcheck on generated bash completion script
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- bash, python
- Ambito
- cli, testing-qa
Direzione di ricerca
Start with the poetry completions bash entry point and inspect how the generated Bash completion script is produced. Run ShellCheck against that generated output, then add verification so the reported parse errors are caught; done means the generated script passes the intended ShellCheck checks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I suggest verifying the validity of a generated bash completion script using shellcheck. It would catch errors like mentioned in https://github.com/python-poetry/cleo/pull/260:
$ shellcheck <(poetry completions bash)
In /dev/fd/63 line 26:
case "$com" in
^-- SC1009 (info): The mentioned syntax error was in this case expression.
In /dev/fd/63 line 40:
(cache clear)
^-- SC1073 (error): Couldn't parse this case item. Fix to allow more checks.
^-- SC1072 (error): Expected ) to open a new case item. Fix any mentioned problems and try again.
^-- SC1085 (error): Did you forget to move the ;; after extending this case item?
For more information:
https://www.shellcheck.net/wiki/SC1085 -- Did you forget to move the ;; aft...
https://www.shellcheck.net/wiki/SC1072 -- Expected ) to open a new case ite...
https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this case item. Fi...
once these are solved, shellcheck suggests some other non-critical changes:
$ shellcheck <(poetry completions bash)
In /dev/fd/63 line 1:
_poetry_6df9602aac65d588_complete()
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
In /dev/fd/63 line 8:
if [[ $(type -t ${words[0]}) == "alias" ]]; then
^---------^ SC2154 (warning): words is referenced but not assigned (did you mean 'word'?).
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
if [[ $(type -t "${words[0]}") == "alias" ]]; then
In /dev/fd/63 line 9:
script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/")
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
script=$(alias "${words[0]}" | sed -E "s/alias ${words[0]}='(.*)'/\1/")
In /dev/fd/63 line 11:
script=${words[0]}
^----^ SC2034 (warning): script appears unused. Verify use (or export if used externally).
In /dev/fd/63 line 15:
for word in ${words[@]:1}; do
^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements.
In /dev/fd/63 line 182:
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).
^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
In /dev/fd/63 line 189:
if [[ $cur == $com ]]; then
^--^ SC2053 (warning): Quote the right-hand side of == in [[ ]] to prevent glob matching.
In /dev/fd/63 line 192:
COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).
^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
For more information:
https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
https://www.shellcheck.net/wiki/SC2034 -- script appears unused. Verify use...
- Lingua principale
- Python
- Stelle
- 1.4k
- Fork
- 104
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 python-poetry/cleo
-
question
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
python-poetry/cleo#471 · 2 commenti ·
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
python-poetry/cleo#467 · 1 reazione ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
python-poetry/cleo#434 · 1 commento ·
-
Support for clink completionApertafeature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
python-poetry/cleo#433 · 4 commenti ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
python-poetry/cleo#423 · 9 commenti ·
Tutte le issue di python-poetry/cleo
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
QuantEcon/lecture-python-programming#642 ·
I maintainer di solito rispondono entro 1 giorno
-
area/config area/profiles comp/cli needs-decision P3 sweeper:risk-compatibility type/feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NousResearch/hermes-agent#133697 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vectorize-io/hindsight#5279 ·
I maintainer di solito rispondono entro 1 giorno