From fe1c1166bba9511c9d351323c0c949bde159b127 Mon Sep 17 00:00:00 2001 From: Prabakaran Kumaresshan Date: Wed, 28 Nov 2018 05:27:18 +0530 Subject: [PATCH] Add missing custom formatter doc (#406) (#421) * Add missing custom formatter doc (#406) * Add custom.rst to docs source * Fix custom formatter docstring --- bandit/formatters/custom.py | 10 +++++++--- doc/source/formatters/custom.rst | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 doc/source/formatters/custom.rst diff --git a/bandit/formatters/custom.py b/bandit/formatters/custom.py index 8b2d7f060..da8c5241a 100644 --- a/bandit/formatters/custom.py +++ b/bandit/formatters/custom.py @@ -13,21 +13,25 @@ # License for the specific language governing permissions and limitations # under the License. -r""" +""" ================ Custom Formatter ================ This formatter outputs the issues in custom machine-readable format. -default template: {abspath}:{line}: {test_id}[bandit]: {severity}: {msg} +default template: ``{abspath}:{line}: {test_id}[bandit]: {severity}: {msg}`` :Example: -/usr/lib/python3.6/site-packages/openlp/core/utils/__init__.py: \ +.. code-block:: none + + /usr/lib/python3.6/site-packages/openlp/core/utils/__init__.py:\ 405: B310[bandit]: MEDIUM: Audit url open for permitted schemes. \ Allowing use of file:/ or custom schemes is often unexpected. +.. versionadded:: 1.5.0 + """ import logging diff --git a/doc/source/formatters/custom.rst b/doc/source/formatters/custom.rst new file mode 100644 index 000000000..ae3fad6f2 --- /dev/null +++ b/doc/source/formatters/custom.rst @@ -0,0 +1,5 @@ +------ +custom +------ + +.. automodule:: bandit.formatters.custom