From 6f2789d4f64e3706b40825e142b0d49fb1331fc8 Mon Sep 17 00:00:00 2001 From: Prabakaran Kumaresshan Date: Wed, 7 Nov 2018 01:07:08 +0530 Subject: [PATCH 1/2] 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..a08b2df07 --- /dev/null +++ b/doc/source/formatters/custom.rst @@ -0,0 +1,5 @@ +---- +custom +---- + +.. automodule:: bandit.formatters.custom From b043c344624d93801ff446da6038d5ebf37ec12d Mon Sep 17 00:00:00 2001 From: Prabakaran Kumaresshan Date: Tue, 27 Nov 2018 23:18:44 +0530 Subject: [PATCH 2/2] Fix custom.rst --- doc/source/formatters/custom.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/formatters/custom.rst b/doc/source/formatters/custom.rst index a08b2df07..ae3fad6f2 100644 --- a/doc/source/formatters/custom.rst +++ b/doc/source/formatters/custom.rst @@ -1,5 +1,5 @@ ----- +------ custom ----- +------ .. automodule:: bandit.formatters.custom