[bug] checkcommit crashes with IndexError when the message has only a prefix
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Describe the bug
checkcommit crashes with an IndexError instead of printing the usual style errors when the commit message only has a prefix and no description after it.
Steps To Reproduce
checkcommit --message "[fix]"
File "openwisp_utils/qa.py", line 108, in check_commit_message
if not suffix[0].isupper():
IndexError: string index out of range
The same happens with "[fix] " and with "[fix]\n\nsome body". An empty message is handled fine (exits with the "missing prefix" error).
Expected behavior
Exit with status 1 and the usual guidelines message, with an error like "please add a description after the prefix", the same way a missing prefix or a lowercase description is reported.
Notes
The cause is that suffix is empty when nothing follows the prefix. I saw that openwisp-qa-check now validates commits with openwisp-commit --check, so I am not sure if the standalone checkcommit is still meant to be supported. If it is, I can send a small fix with a test in test_qa.py. I will wait for confirmation before opening a PR.
System Information
- OS: Windows 11
- Python Version: 3.13
- openwisp-utils: master (3497e3f)
- Lingua principale
- Python
- Stelle
- 96
- Fork
- 127
- Merge medio
- 1g 5h
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 openwisp/openwisp-utils
-
[bug] QA checks do not ignore version-suffixed virtual environmentsForse di nuovo libera @AradhyaTiwari10 l’ha presa 15 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openwisp/openwisp-utils#830 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[bug] admin filter options cannot be selected in SafariForse di nuovo libera @anish-123-2006 l’ha presa 35 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openwisp/openwisp-utils#768 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[feature] Add CHROMEDRIVER_LOG env var to enable logfile in get_chrome_webdriverForse di nuovo libera @iamdhrv l’ha presa 144 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
openwisp/openwisp-utils#717 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[feature] Centralize the django-reversion dependencyForse già presa @S-h-u-b-h-1 l’ha presa 28 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
openwisp/openwisp-utils#812 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[bug] Pre-push hook always fails because of Selenium testsForse già presa @shubhamk0205 l’ha presa 12 giorni fa. Apertabug
openwisp/openwisp-utils#785 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openwisp/openwisp-utils
Issue simili
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%Forse già presa @sumitkhond111-del l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bmad-code-org/BMAD-METHOD#3358 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
open-mmlab/mmcv#3352 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
OpenGithubs/weekly#263 ·
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
-
comp/cli P3 type/feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
NousResearch/hermes-agent#162784 ·
I maintainer di solito rispondono entro 1 giorno