.bandit ignored for single files
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.3k
- Forks
- 835
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 1
Description
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, running
bandit -r tests/
has different results than
bandit -r tests/test_cli.py
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
bandit 1.4.0
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
Start by reproducing the difference between bandit -r tests/ and bandit -r tests/test_cli.py with the tests/.bandit configuration. Trace the CLI configuration-discovery path, then use tests/test_cli.py for coverage; done means single-file scans apply the expected directory configuration consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, security, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100