tylerwince / flake8-bandit

Automated security testing using bandit and flake8.
MIT License
111 stars 23 forks source link

Support `nosec` comments #20

Open scop opened 3 years ago

scop commented 3 years ago

Currently if one wants to skip a bandit message for "raw" bandit checks (using the bandit executable) in addition to ones done via flake8-bandit, both the noqa and nosec comments need to be used. For example:

assert True  # noqa: S101 # nosec: B101

The noqa: S101 is required for flake8 to not flag the use of assert, but that's not enough for "raw" bandit. For that the nosec: B101 is needed. But that has no effect on flake8-bandit, so both are needed.

Would be good if the nosec comment was enough for both, maybe flake8-bandit can do something about it?