Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepend ./ for files specified as CLI args (PyCQA#1094)
The get_module_qualname_from_path() function called by the node visistor expects that all files are explicitly named with a "head" and "tail" which are path delimiters to denote where the file is within a python project. However, if someone uses the command line and simply asks bandit to scan dummy.py in the current working directory, it will be missing the explicit "./" prefix in order for get_module_qualname_from_path to run and determine the module fully qualified name from the path. So this fix simply prepends a dot and delimiter to explicitly denote a file in the current working directory as given from the CLI. Fixes PyCQA#907 Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
- Loading branch information