Skip to content

exclude supports ./tests but not tests (with the default . target) #14

@huyz

Description

@huyz

Describe the bug
It took me way too long to figure out why exclude: tests didn't work. It seems that counter-intuitively tests doesn't work to exclude directories when the default target is ., presumably because Bandit sees the directory as ./tests and doesn't recognize that tests and ./tests refer to the same directory..

To Reproduce
Steps to reproduce the behavior:

  1. Have a tests/ subdirectory of files with some bandit issues.
  2. Specify exclude: tests
  3. Leave default target as .

Expected behavior
Bandit action doesn't report warnings for any files under tests/

Actual behavior
Bandit scans the tests and reports warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions