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:
parent
7ec796970f
commit
aa2c133668
|
@ -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
|
||||
-------------------
|
||||
|
|
Loading…
Reference in New Issue