use flake8 for style checks

Change-Id: I25af2e978a8d11b84b930308516d597c75b387e0
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
This commit is contained in:
Doug Hellmann 2013-03-16 11:04:11 -07:00
parent 5233a27fe5
commit 18f649c229
12 changed files with 63 additions and 49 deletions

View File

@ -39,7 +39,9 @@ class CommandManager(object):
def _load_commands(self):
for ep in pkg_resources.iter_entry_points(self.namespace):
LOG.debug('found command %r', ep.name)
cmd_name = ep.name.replace('_', ' ') if self.convert_underscores else ep.name
cmd_name = (ep.name.replace('_', ' ')
if self.convert_underscores
else ep.name)
self.commands[cmd_name] = ep
return

View File

@ -3,7 +3,8 @@
# cliff documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 25 11:14:29 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@ -11,20 +12,22 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import datetime
import subprocess
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
@ -41,14 +44,18 @@ master_doc = 'index'
# General information about the project.
project = u'cliff'
copyright = u'2012, Doug Hellmann'
copyright = u'2012-%s, Doug Hellmann' % datetime.datetime.today().year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.3.1'
version = subprocess.check_output([
'sh', '-c',
'cd ../..; python setup.py --version',
])
version = version.strip()
# The full version, including alpha/beta/rc tags.
release = version
@ -66,7 +73,8 @@ release = version
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
@ -87,7 +95,7 @@ pygments_style = 'sphinx'
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@ -167,21 +175,22 @@ html_static_path = ['_static']
htmlhelp_basename = 'cliffdoc'
# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# (source start file, target name, title, author,
# documentclass [howto/manual]).
latex_documents = [
('index', 'cliff.tex', u'cliff Documentation',
u'Doug Hellmann', 'manual'),
@ -208,7 +217,7 @@ latex_documents = [
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
@ -221,7 +230,7 @@ man_pages = [
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,

View File

@ -8,6 +8,9 @@ dev
method to allow underscores to be used in command names. This optional
argument is defaulted to True to maintain current behavior.
(contributed by Joe Server)
- Use flake8_ for style checking.
.. _flake8: https://pypi.python.org/pypi/flake8
1.3.1

View File

@ -1,5 +1,5 @@
[tox]
envlist = py26,py27,py32,pep8
envlist = py26,py27,py32,style
[testenv]
commands = nosetests -d --with-coverage --cover-inclusive --cover-package cliff []
@ -8,6 +8,6 @@ deps =
mock
coverage
[testenv:pep8]
deps = pep8
commands = pep8 --repeat --ignore=E501 --ignore=E123 --show-source cliff
[testenv:style]
deps = flake8
commands = flake8 cliff docs/source/conf.py