You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case due to the use of assert statements i need to process all the tests and provide a # nosec argument.
Expected behavior
When providing a config with the exclude option i would expect that the exclude option is working. And the correct directory is ignored by Bandit for further processing.
@mpas were you by any chance using windows? (a quick glance at your blog suggests no, but you never know)
seems like on windows you would need to specify the path as ./tests/*.
which is rather annoying if you work on a project with both windows & linux, then you need to specify each path twice (in a slightly different manner).
Are you using pre-commit? I ran into this problem with several libraries. Pre-commit ignores the excludes in the toml file for some reason, so you have add exclude to the pre-commit-config.yaml.
Describe the bug
When trying to run Bandit using the CLI and providing a
ini
,pyproject
oryaml
file for the configuration the exclude option is not working.Reproduction steps
In all situations the exclude is not functioning.
Run using
bandit -r .
Run using
bandit -c pyproject.toml -r .
Run using
bandit -c bandit.yaml -r .
In my case due to the use of
assert
statements i need to process all the tests and provide a# nosec
argument.Expected behavior
When providing a config with the exclude option i would expect that the exclude option is working. And the correct directory is ignored by Bandit for further processing.
Bandit version
1.7.4 (Default)
Python version
3.9
Additional context
See also #499
No response
The text was updated successfully, but these errors were encountered: