-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.bandit ignored for single files #332
Comments
Bandit only looks for config files if the target is a directory. The relevant code is in |
@amacfie a use case (for me) is as follows, say I want bandit to ignore use of asserts in the tests folder. I configured I assumed this was a bug as the expected behaviour is to follow the config? IIRC other linters follow the config. Is there a use case to run bandit on files excluded on the config? |
This is actually really bad for CodeFactor, because I don't think it runs Bandit on a directory. So I'm getting F's for my repository, because of 99 errors regarding usage of |
Hi, the following may be helpful to configure There are also some suggestion for how to configure VSCode to properly use |
When doing a single file, bandit doesn't use the .bandit file in the directory. If it's agreed that it should work like this, I'm happy to do a PR to fix it.
With a config file
tests/.bandit
, runninghas different results than
Expected behavior
I would expect bandit to search each directory to root for a .bandit file and apply the first found to the test run.
Bandit version
The text was updated successfully, but these errors were encountered: