Adding missing section to documentation about gen_config

This commit adds a missing section in the Bandit plugin
documentation for developers that describes how gen_config should
be used to declare and set default values for parameters.

Closes-Bug: #1602002
Change-Id: Iac3135394c9f723f04d9756459a0d5595de07021
This commit is contained in:
Travis McPeak 2016-07-11 14:12:40 -07:00
parent 7ec796970f
commit aa2c133668
1 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,19 @@ To write a test:
vulnerability might present itself and extend the example file and the test
function accordingly.
Config Generation
-----------------
In Bandit 1.0+ config files are no longer required. Plugins are expected to
declare all required parameters by implementing `gen_config`. If your plugin
requires parameters, use `gen_config` to declare parameter names and default
values as follows:
.. code-block:: python
def gen_config(name):
if name == 'try_except_continue':
return {'check_typed_exception': False}
Example Test Plugin
-------------------