Quellcode durchsuchen

Setup a tox pep8 check and update test-requirements.txt

Add a tox pep8 check.
Fix PEP8 error in tools/list_ptls.py

Update test-requirements.txt for libraries used.

Change-Id: I179036ebbce555586a711677f45337b364d4847f
changes/98/319398/1
John L. Villalovos vor 3 Jahren
Ursprung
Commit
ffa7d55448
4 geänderte Dateien mit 40 neuen und 3 gelöschten Zeilen
  1. 3
    0
      test-requirements.txt
  2. 20
    0
      test_tools/flake8wrap.sh
  3. 2
    1
      tools/list_ptls.py
  4. 15
    2
      tox.ini

+ 3
- 0
test-requirements.txt Datei anzeigen

@@ -1 +1,4 @@
hacking<0.11,>=0.10.0
PyYAML>=3.1.0 # MIT
requests>=2.10.0 # Apache-2.0
yaml2ical>=0.6.1

+ 20
- 0
test_tools/flake8wrap.sh Datei anzeigen

@@ -0,0 +1,20 @@
#!/bin/bash
#
# A simple wrapper around flake8 which makes it possible
# to ask it to only verify files changed in the current
# git HEAD patch.
#
# Intended to be invoked via tox:
#
# tox -epep8 -- -HEAD
#

if test "x$1" = "x-HEAD" ; then
shift
files=$(git diff --name-only HEAD~1 | tr '\n' ' ')
echo "Running flake8 on ${files}"
diff -u --from-file /dev/null ${files} | flake8 --diff "$@"
else
echo "Running flake8 on all files"
exec flake8 "$@"
fi

+ 2
- 1
tools/list_ptls.py Datei anzeigen

@@ -22,6 +22,7 @@ import yaml

PROJECTS_LIST = "http://git.openstack.org/cgit/openstack/governance/plain/reference/projects.yaml" # noqa


def main():
parser = argparse.ArgumentParser()
parser.add_argument(
@@ -57,7 +58,7 @@ def main():
initial_indent=args.msg + ' ',
subsequent_indent=args.msg + ' ',
width=80,
))
))


if __name__ == '__main__':

+ 15
- 2
tox.ini Datei anzeigen

@@ -1,5 +1,5 @@
[tox]
envlist = ical
envlist = ical,pep8
minversion = 1.6
skipsdist = True

@@ -7,12 +7,12 @@ skipsdist = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = mkdir

[testenv:venv]
commands = {posargs}

[testenv:ical]
whitelist_externals = mkdir
commands =
mkdir -p output/calendars
yaml2ical -n "OpenStack Meetings" \
@@ -24,3 +24,16 @@ commands =
[testenv:check]
commands =
python tools/check_channels.py -y meetings

[testenv:pep8]
whitelist_externals = bash
commands =
bash test_tools/flake8wrap.sh {posargs}

[flake8]
ignore =
exclude = .git,.tox
max-complexity = 14

[hacking]
import_exceptions =

Laden…
Abbrechen
Speichern