From fc72b4d904ebe05ee82adb7e156bde9781a9b2f4 Mon Sep 17 00:00:00 2001
From: Lucas Alvares Gomes <lucasagomes@gmail.com>
Date: Wed, 27 Jan 2016 10:36:33 +0000
Subject: [PATCH] Enable doc8 style checker for *.rst files

This patch is enabling the doc8 style checker for the *.rst files in
Ironic.

Since this patch is just the first stab at enabling this new check two
errors are currently being ignored by doc8 because of the number of
occurrences in our docs:

* D000 - Duplicated target names. We do have many links with generic
         names scattered around the docs (e.g "see", "link")

* D001 - Line's too long

These errors will be fixed in a following patch.

Change-Id: I32fb5a3104b9773c55a80a84dd81e49c567c76ac
---
 doc/source/dev/contributing.rst | 2 +-
 doc/source/drivers/amt.rst      | 6 ++----
 doc/source/drivers/oneview.rst  | 2 +-
 test-requirements.txt           | 1 +
 tox.ini                         | 2 ++
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/doc/source/dev/contributing.rst b/doc/source/dev/contributing.rst
index 2055dd01a1..78423172c7 100644
--- a/doc/source/dev/contributing.rst
+++ b/doc/source/dev/contributing.rst
@@ -48,7 +48,7 @@ Bug tracker
 
 Mailing list (prefix subjects with ``[ironic]`` for faster responses)
     http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-    
+
 Wiki
     http://wiki.openstack.org/Ironic
 
diff --git a/doc/source/drivers/amt.rst b/doc/source/drivers/amt.rst
index 17b657b75c..f5cbe9a2b1 100644
--- a/doc/source/drivers/amt.rst
+++ b/doc/source/drivers/amt.rst
@@ -61,16 +61,14 @@ A detailed reference is available here, and a short guide follows below:
   * Ubuntu: ``python-openwsman``'s most recent version is 2.4.3 which
     is enough.
 
-  * Or build it yourself from::
-
-    https://github.com/Openwsman/openwsman
+  * Or build it yourself from: https://github.com/Openwsman/openwsman
 
 * Enable the ``pxe_amt`` or ``agent_amt`` driver by adding it to the
   configuration option ``enabled_drivers`` (typically located at
   ``/etc/ironic/ironic.conf``) and restart the ``ironic-conductor``
   process::
 
-  service ironic-conductor restart
+    service ironic-conductor restart
 
 * Enroll an AMT node
 
diff --git a/doc/source/drivers/oneview.rst b/doc/source/drivers/oneview.rst
index 3ceabdd6e1..bb2715d5b3 100644
--- a/doc/source/drivers/oneview.rst
+++ b/doc/source/drivers/oneview.rst
@@ -126,7 +126,7 @@ Overview
 ``agent_pxe_oneview`` driver uses PXEBoot for boot and AgentDeploy for deploy.
 
 Configuring and enabling the driver
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 1. Add ``agent_pxe_oneview`` to the list of ``enabled_drivers`` in
    ``/etc/ironic/ironic.conf``. For example::
diff --git a/test-requirements.txt b/test-requirements.txt
index f3fa9cc804..bc4cb6f8ba 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,6 +3,7 @@
 # process, which may cause wedges in the gate later.
 hacking<0.11,>=0.10.0
 coverage>=3.6 # Apache-2.0
+doc8 # Apache-2.0
 fixtures>=1.3.1 # Apache-2.0/BSD
 mock>=1.2 # BSD
 Babel>=1.3 # BSD
diff --git a/tox.ini b/tox.ini
index 2b78987aea..69b9200b51 100644
--- a/tox.ini
+++ b/tox.ini
@@ -31,6 +31,8 @@ commands =
   {toxinidir}/tools/run_bashate.sh {toxinidir}/devstack
   # Check that .po and .pot files are valid:
   bash -c "find ironic -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
+  # Check the *.rst files
+  doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001 --ignore D000
 
 [testenv:cover]
 setenv = VIRTUAL_ENV={envdir}