Output examples in the CSV, JSON and YAML formatter docs are out of date
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.pybandit -f json examples/yaml_load.pybandit -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.
Rechecked main: csv.py still lists the header without col_offset and end_col_offset (lines 14 and 15), and the writer adds them (lines 65 and 66). Nothing under bandit/formatters has changed since Sep 2025, so the diff in my branch still applies as is. Since I can't open PRs, would one of you be up for cherry picking it? If you'd rather split it per formatter, I can do that.
Hello,
I'm interested in contributing to Bandit as a new Python open-source contributor. I've reviewed the contribution guide and started working through the codebase.
I've noticed that pull-request creation is currently restricted to collaborators, and that several contributors have prepared fixes on their forks but cannot submit them directly.
Is there an alternative process for external contributors? For example, could maintainers review a fork branch, cherry-pick a proposed commit, or enable pull requests for an approved contribution?
I'd be happy to follow whatever review and testing process the project prefers.
Thank you.