Fixed pep8 and flake8 errors in doc/source/conf.py and updated flake8 commands in tox.ini to test it.

Change-Id: I2add370e4cfb55d1388e3a8b41f688a7f3f2c621
This commit is contained in:
Olga Saprycheva 2016-03-04 15:19:39 -06:00
parent 9891039b8d
commit 2cff2dec3d
2 changed files with 57 additions and 44 deletions

View File

@ -1,4 +1,17 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# 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.
#
# Copyright (c) 2010-2012 OpenStack Foundation. # Copyright (c) 2010-2012 OpenStack Foundation.
# #
# Swift documentation build configuration file, created by # Swift documentation build configuration file, created by
@ -15,6 +28,7 @@
import datetime import datetime
import os import os
from swift import __version__
import subprocess import subprocess
import sys import sys
@ -61,7 +75,6 @@ copyright = u'%d, OpenStack Foundation' % datetime.datetime.now().year
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
from swift import __version__
version = __version__.rsplit('.', 1)[0] version = __version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = __version__ release = __version__

View File

@ -29,7 +29,7 @@ commands =
[testenv:pep8] [testenv:pep8]
basepython = python2.7 basepython = python2.7
commands = commands =
flake8 {posargs:swift test doc setup.py} flake8 {posargs:swift test doc setup.py doc/source/conf.py}
flake8 --filename=swift* bin flake8 --filename=swift* bin
[testenv:py3pep8] [testenv:py3pep8]
@ -39,7 +39,7 @@ commands =
# Gross hack. There's no other way to get it to /not/ install swift itself # Gross hack. There's no other way to get it to /not/ install swift itself
# (which triggers installing eventlet) but also get flake8 installed. # (which triggers installing eventlet) but also get flake8 installed.
pip install flake8 pip install flake8
flake8 swift test doc setup.py flake8 swift test doc setup.py doc/source/conf.py
flake8 --filename=swift* bin flake8 --filename=swift* bin
[testenv:func] [testenv:func]
@ -75,5 +75,5 @@ commands = bandit -c bandit.yaml -r swift bin -n 5 -p gate
# H501: Do not use self.__dict__ for string formatting # H501: Do not use self.__dict__ for string formatting
# H703: Multiple positional placeholders # H703: Multiple positional placeholders
ignore = F812,H101,H202,H233,H301,H306,H401,H403,H404,H405,H501,H703 ignore = F812,H101,H202,H233,H301,H306,H401,H403,H404,H405,H501,H703
exclude = .venv,.tox,dist,doc,*egg exclude = .venv,.tox,dist,*egg
show-source = True show-source = True