doc: Enable pep8 on doc generation code

As pep8 does not run on doc generation python code so we have some
style violations there. As it not too hard to fix the problems and
therefore enable pep8 on these files this patch proposes such a
change.

Change-Id: I26104ea66fc4f3e67f8227025f43202e483beb25
This commit is contained in:
Stephen Finucane 2017-07-12 10:40:37 +01:00
parent 6671ddc832
commit 62ccbe1c3f
4 changed files with 22 additions and 9 deletions

View File

@ -25,7 +25,6 @@ It is used via a single directive in the .rst file
import re import re
import sys import sys
import six
from six.moves import configparser from six.moves import configparser
from docutils import nodes from docutils import nodes
@ -59,7 +58,9 @@ class SupportMatrixFeature(object):
STATUS_CONDITION, STATUS_OPTIONAL] STATUS_CONDITION, STATUS_OPTIONAL]
def __init__(self, key, title, status=STATUS_OPTIONAL, def __init__(self, key, title, status=STATUS_OPTIONAL,
group=None, notes=None, cli=[]): group=None, notes=None, cli=None):
if not cli:
cli = []
# A unique key (eg 'foo.bar.wizz') to identify the feature # A unique key (eg 'foo.bar.wizz') to identify the feature
self.key = key self.key = key
# A human friendly short title for the feature # A human friendly short title for the feature
@ -474,10 +475,10 @@ class SupportMatrixDirective(rst.Directive):
notes.append(item) notes.append(item)
def _create_cli_paragraph(self, feature): def _create_cli_paragraph(self, feature):
''' Create a paragraph which represents the CLI commands of the feature """Create a paragraph which represents the CLI commands of the feature
The paragraph will have a bullet list of CLI commands. The paragraph will have a bullet list of CLI commands.
''' """
para = nodes.paragraph() para = nodes.paragraph()
para.append(nodes.strong(text="CLI commands:")) para.append(nodes.strong(text="CLI commands:"))
commands = nodes.bullet_list() commands = nodes.bullet_list()
@ -489,7 +490,7 @@ class SupportMatrixDirective(rst.Directive):
return para return para
def _create_notes_paragraph(self, notes): def _create_notes_paragraph(self, notes):
""" Constructs a paragraph which represents the implementation notes """Constructs a paragraph which represents the implementation notes
The paragraph consists of text and clickable URL nodes if links were The paragraph consists of text and clickable URL nodes if links were
given in the notes. given in the notes.

View File

@ -22,8 +22,8 @@ It is used via a single directive in the .rst file
from docutils import nodes from docutils import nodes
import importlib import importlib
from sphinx.util.compat import Directive
import pkgutil import pkgutil
from sphinx.util.compat import Directive
import nova.notifications.objects import nova.notifications.objects
from nova.notifications.objects import base as notification from nova.notifications.objects import base as notification

View File

@ -1,12 +1,24 @@
# nova documentation build configuration file # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# nova documentation build configuration file
# #
# Refer to the Sphinx documentation for advice on configuring this file: # Refer to the Sphinx documentation for advice on configuring this file:
# #
# http://www.sphinx-doc.org/en/stable/config.html # http://www.sphinx-doc.org/en/stable/config.html
import os
import subprocess import subprocess
import sys import sys
import os
import warnings import warnings
from nova.version import version_info from nova.version import version_info

View File

@ -177,7 +177,7 @@ commands = bash -c tools/releasenotes_tox.sh
enable-extensions = H106,H203,H904 enable-extensions = H106,H203,H904
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools/xenserver*,releasenotes exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools/xenserver*,releasenotes
# To get a list of functions that are more complex than 25, set max-complexity # To get a list of functions that are more complex than 25, set max-complexity
# to 25 and run 'tox -epep8'. # to 25 and run 'tox -epep8'.
# 34 is currently the most complex thing we have # 34 is currently the most complex thing we have