Pretty up the formatter docs

* The formatter docs should use same sphinx tags as the plugins
* The screen formatter was missing docs

Change-Id: I8031644df5dc8469a00bdf7308f995810660744a
This commit is contained in:
Eric Brown 2016-01-15 20:30:18 -08:00
parent 541dc8928f
commit ce8530b3b6
7 changed files with 59 additions and 20 deletions

View File

@ -13,12 +13,14 @@
# under the License.
r"""
Description
-----------
=============
CSV Formatter
=============
This formatter outputs the issues in a comma separated values format.
Sample Output
-------------
:Example:
.. code-block:: none
filename,test_name,test_id,issue_severity,issue_confidence,issue_text,

View File

@ -14,12 +14,14 @@
# under the License.
r"""
Description
-----------
==============
HTML formatter
==============
This formatter outputs the issues as HTML.
Sample Output
-------------
:Example:
.. code-block:: html
<!DOCTYPE html>

View File

@ -13,12 +13,14 @@
# under the License.
r"""
Description
-----------
==============
JSON formatter
==============
This formatter outputs the issues in JSON.
Sample Output
-------------
:Example:
.. code-block:: javascript
{

View File

@ -13,6 +13,30 @@
# License for the specific language governing permissions and limitations
# under the License.
r"""
================
Screen formatter
================
This formatter outputs the issues as color coded text.
:Example:
.. code-block:: none
>> Issue: [B301:blacklist_calls] Use of unsafe yaml load. Allows
instantiation of arbitrary objects. Consider yaml.safe_load().
Severity: Medium Confidence: High
Location: examples/yaml_load.py:5
4 ystr = yaml.dump({'a' : 1, 'b' : 2, 'c' : 3})
5 y = yaml.load(ystr)
6 yaml.dump(y)
.. versionadded:: 0.9.0
"""
from __future__ import print_function
import datetime

View File

@ -14,12 +14,14 @@
# under the License.
r"""
Description
-----------
==============
Text Formatter
==============
This formatter outputs the issues as plain text.
Sample Output
-------------
:Example:
.. code-block:: none
>> Issue: [B301:blacklist_calls] Use of unsafe yaml load. Allows

View File

@ -13,12 +13,14 @@
# under the License.
r"""
Description
-----------
=============
XML Formatter
=============
This formatter outputs the issues as XML.
Sample Output
-------------
:Example:
.. code-block:: xml
<?xml version='1.0' encoding='utf-8'?>

View File

@ -0,0 +1,5 @@
------
screen
------
.. automodule:: bandit.formatters.screen