Option to output violation information of skipped tests/lines
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.3k
- Forks
- 836
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 1
Description
Problem to Solve
Without the complete violation information, we cannot know whether certain tests or lines are being skipped reasonably. This option allows us to make more informed judgements.
Proposed Solution
- Our team works with the SARIF output format. Therefore, it's desirable if Bandit could output to SARIF directly when used with the flag
-f sarif. - When Bandit is executed with the combination of flags
-f sarifand--output-suppression, it should run all lines in a file against not only the tests to include specified via-t(command line) /tests(external command line argument & external configuration file), but also the tests specified to be skipped via-s(command line) /skips(external command line argument & external configuration file). - In the SARIF output of Bandit, aside from the original content it normally contains, there should also be violations caused by "skipped" tests and lines, along with the kind and justification of a skipped test (a.k.a. suppression in SARIF terms). Here is an example:

- Ideally every skipped test/line should have an accompanying explanation (justification), as my colleague André stated in #478. We are also willing to contribute to this.
Alternatives
As said in #646, if the SARIF output is planned to be included in the near future, our team would be happy to contribute. If not, we are okay with modifying bandit-sarif-formatter together as well.
Please let us know what you think. Thank you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named in the issue. Start by locating Bandit's current formatter and handling of -t/-s with --output-suppression, then review bandit-sarif-formatter and the SARIF suppression fields cited here. Done means SARIF output includes skipped-test and skipped-line violations with suppression kind and justification while preserving normal output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100