RETIRED, further work has moved to Debian project infrastructure
Go to file
Jamie Finnigan 7c94d3625e Fix relative imports and error handling
This deals with relative imports in visit_ImportFrom.  Also adds
try/except around ast.parse() call to catch any files with non-valid
source or syntax errors.
2014-07-17 11:52:33 -07:00
bandit Fix relative imports and error handling 2014-07-17 11:52:33 -07:00
examples Fix relative imports and error handling 2014-07-17 11:52:33 -07:00
plugins Support dynamic loading of tests 2014-07-17 11:23:57 -07:00
.gitignore initial commit 2014-07-16 10:27:50 -07:00
bandit.ini Support dynamic loading of tests 2014-07-17 11:23:57 -07:00
main.py Support dynamic loading of tests 2014-07-17 11:23:57 -07:00
README.md Support dynamic loading of tests 2014-07-17 11:23:57 -07:00
TODO initial commit 2014-07-16 10:27:50 -07:00

Bandit

A Python AST-based static analyzer from OpenStack Security Group.

References

Python AST module documentation: https://docs.python.org/2/library/ast.html

Green Tree Snakes - the missing Python AST docs: http://greentreesnakes.readthedocs.org/en/latest/

Usage

Example usage across a code tree:

find ~/openstack-repo/keystone -name '*.py' | xargs ./main.py -C 1

Usage:

$ ./main.py -h
usage: main.py [-h] [-C CONTEXT_LINES] [-t TEST_CONFIG] [-l] [-d]
               file [file ...]

Bandit - a Python source code analyzer.

positional arguments:
  file                  source file/s to be tested

optional arguments:
  -h, --help            show this help message and exit
  -C CONTEXT_LINES, --context CONTEXT_LINES
                        number of context lines to print
  -t TEST_CONFIG, --testconfig TEST_CONFIG
                        test config file (default: bandit.ini)
  -l, --level           results level filter
  -d, --debug           turn on debug mode