`make static-check` fails on master: Makefile uses --max-complexity=10, CI uses 11

Aperta Adatta ai principianti
#3,778 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ci-cd, tooling

Direzione di ricerca

Leggi .github/workflows/run-tests.yaml:53, Makefile:42 e scripts/README.md:358 per confrontare i limiti di complessità usati da CI e dal controllo locale. Aggiorna i due comandi locali documentati in modo che corrispondano al limite di CI, poi esegui make static-check; il lavoro è completato se termina correttamente, come in CI.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
make static-check fails on a clean master checkout. CI's flake8 step was moved to --max-complexity=11 in 022bdeb8 (.github/workflows/run-tests.yaml:53), but Makefile:42 and the Windows command in scripts/README.md:358 still use 10. Two functions are now at 11, so CI passes while the local check fails. scripts/README.md also suggests running make static-check from a pre-commit hook, and that hook currently blocks every commit.

To Reproduce

  1. Check out master (94d0d878)
  2. Run make static-check
  3. See:
./scripts/convert.py:999:1: C901 'get_template_for_edition' is too complex (11)
./scripts/pdf_generation/merge_pdfs.py:327:1: C901 'main' is too complex (11)
make: *** [static-check] Error 1

Expected behavior
make static-check passes whenever CI's lint step passes.

Desktop

  • OS: macOS, Docker 29.9.2

Additional context
Setting 11 in Makefile:42 and scripts/README.md:358 fixes it; make static-check then exits 0. If you'd rather keep 10, I can refactor the two functions instead. Could I be assigned?

Lingua principale
Python
Stelle
158
Fork
110
Merge medio
1g 11h
PR unite (30g)
115

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OWASP/cornucopia

Tutte le issue di OWASP/cornucopia

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.