Output examples in the CSV, JSON and YAML formatter docs are out of date
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- documentation
Direzione di ricerca
Leggi le docstring dei moduli in bandit/formatters/csv.py, bandit/formatters/json.py e bandit/formatters/yaml.py. Esegui ogni formatter su examples/yaml_load.py e confronta il suo output con gli esempi mostrati nelle pagine della documentazione dei formatter. Aggiorna gli esempi in modo che corrispondano all’output attuale, inclusi i campi e i nomi dei finding descritti nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The output examples in the module docstrings of bandit/formatters/csv.py, json.py and yaml.py (shown on the "Report formatters" docs pages) don't match what Bandit prints today:
- CSV: the header doesn't have
col_offsetandend_col_offset, but the formatter writes them. - JSON and YAML: the results don't have
col_offsetandend_col_offset, and the metrics don't haveskipped_tests. The YAML example also doesn't haveissue_cwe. - CSV and JSON show the
yaml.loadfinding asblacklist_calls/B301. The real output isyaml_load/B506.
Reproduction steps
- From a checkout of the repo, run:
bandit -f csv examples/yaml_load.py
bandit -f json examples/yaml_load.py
bandit -f yaml examples/yaml_load.py - Compare the output with the examples on the CSV, JSON and YAML formatter docs pages.
Expected behavior
The examples in the docs match the current output of each formatter.
Bandit version
1.9.5.dev23 (main)
Python version
3.14
Additional context
PRs are limited to collaborators, so I regenerated the three examples from the real output of examples/yaml_load.py on a branch on my fork (docstrings only):
https://github.com/PyCQA/bandit/compare/main...Dio77799:bandit:docs/formatter-examples
The XML example has the same blacklist_calls / B301 problem. I didn't touch it here because my branch for #1304 changes that same docstring.
- Lingua principale
- Python
- Stelle
- 8.4k
- Fork
- 893
- Merge medio
- 6h 52m
- PR unite (30g)
- 3
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 PyCQA/bandit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Turn off progress bar in CIForse già presa @silvatechf l’ha presa 28 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
`bandit -ii -ll -ii -ll` raises an `IndexError`Forse già presa @botbikamordehai2-sketch l’ha presa 181 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
False negative: B104 misses `bind(("", port))` wildcard hostForse già presa @mokashang l’ha presa 196 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Tutte le issue di PyCQA/bandit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Library sweep logs an ERROR at start for the valkey instrumentor when valkey-py is not installedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
JoahanMorales/upiixia-agentic-kit#99 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
NatLabRockies/openstudio-mcp#286 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100