Skip to content

Commit

Permalink
Trigger sphinx-apidoc from sphinx's conf.py - See readthedocs/readthe…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Amrani Hernández committed Mar 27, 2018
1 parent e053e19 commit 5379324
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 192 deletions.
62 changes: 0 additions & 62 deletions docs/source/atomshields.checkers.rst

This file was deleted.

30 changes: 0 additions & 30 deletions docs/source/atomshields.helpers.rst

This file was deleted.

38 changes: 0 additions & 38 deletions docs/source/atomshields.reports.rst

This file was deleted.

31 changes: 0 additions & 31 deletions docs/source/atomshields.rst

This file was deleted.

37 changes: 19 additions & 18 deletions docs/source/checkers.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@

Checkers
========


DS_STORE
--------
DS_STORE is a Mac OS X file containing information about the system that created it.
These files are rarely filtered in. gitignore, providing information about the system of the author of the repository.
These files are rarely filtered in. gitignore, providing information about the system of the
author of the repository.

.. autosummary::
atomshields.checkers.dsstore.DSStoreChecker

.. automodule:: atomshields.checkers.dsstore
:members:
:undoc-members:
:show-inheritance:

----------------------------------------------------------------------------------------------------


RetireJS
--------
The goal of Retire.js is to help you detect use of version of JavaScript libraries with known vulnerabilities.
This checker finds js files with vulnerabilities. Also, the checker finds and download JS files linked via URL.
The goal of Retire.js is to help you detect use of version of JavaScript libraries with
known vulnerabilities. This checker finds js files with vulnerabilities.
Also, the checker finds and download JS files linked via URL.

.. autosummary::
atomshields.checkers.retirejs.RetireJSChecker


.. automodule:: atomshields.checkers.retirejs
:members:
:undoc-members:
:show-inheritance:
----------------------------------------------------------------------------------------------------


Target-blank
------------

This checker helps you to detect the *target blank* vulnerability in your code files. For more details about the vulnerability
please see `this link <https://dev.to/ben/the-targetblank-vulnerability-by-example>`_.
This checker helps you to detect the *target blank* vulnerability in your code files.
For more details about the vulnerability please see
`this link <https://dev.to/ben/the-targetblank-vulnerability-by-example>`_.

.. automodule:: atomshields.checkers.targetblank
:members:
:undoc-members:
:show-inheritance:
.. autosummary::
atomshields.checkers.targetblank.TargetBlankChecker
22 changes: 20 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
import os
import sys
import subprocess

sys.path.insert(0, os.path.abspath('../'))

def read_file(filename):
Expand All @@ -29,7 +31,7 @@ def read_file(filename):
author = u'ElevenPaths - Telefonica Digital España'

# The short X.Y version
version = u'0.1'
version = read_file('../../VERSION')
# The full version, including alpha/beta/rc tags
release = read_file('../../VERSION')

Expand Down Expand Up @@ -170,6 +172,22 @@ def read_file(filename):


# -- Extension configuration -------------------------------------------------

autosummary_generate = True
autodoc_member_order = 'bysource'


# -- Running sphinx-apidoc ---------------------------------------------------
# Automate building apidoc when building with readthedocs
# https://github.com/rtfd/readthedocs.org/issues/1139
def run_apidoc(_):
module = '../atomshields/'
cur_dir = os.path.abspath(os.path.dirname(__file__))
output_path = os.path.join(cur_dir)
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
subprocess.check_call([cmd_path, '-e', '-o', output_path, module, '--force'])

def setup(app):
app.connect('builder-inited', run_apidoc)
22 changes: 11 additions & 11 deletions docs/source/reports.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

Reports
========


Echo
----
This reports prints on screen a summary of all issues found. The fields printed are Name, Severity and File affected.
This reports prints on screen a summary of all issues found. The fields printed are Name,
Severity and File affected.

.. autosummary::
atomshields.reports.echo.EchoReport


.. automodule:: atomshields.reports.echo
:members:
:undoc-members:
:show-inheritance:
----------------------------------------------------------------------------------------------------


Http Request
------------
Sends hte full information of issues via HTTP. The endpoint must be setted into the config file in the directory *.atomshields* into your home path.
Sends hte full information of issues via HTTP. The endpoint must be setted into the config file in
the directory *.atomshields* into your home path.

.. automodule:: atomshields.reports.http
:members:
:undoc-members:
:show-inheritance:
.. autosummary::
atomshields.reports.http.HttpReport

0 comments on commit 5379324

Please sign in to comment.