~harlowja/cloud-init/tox-venvs

« back to all changes in this revision

Viewing changes to tools/run-pep8

  • Committer: Joshua Harlow
  • Date: 2014-01-26 01:00:38 UTC
  • Revision ID: harlowja@gmail.com-20140126010038-smsyr4lztcjrpk81
Use a venv for testing and for lint checking

Remove the pep8 & pylint tools and use a venv
with tox instead. Also create a venv that will
run for the given python version to perform the
cloud-init tests.

These help remove the need to install the same
dependencies in the root python environment env
to just run the standard set of tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
if [ $# -eq 0 ]; then
4
 
   files=( bin/cloud-init $(find * -name "*.py" -type f) )
5
 
else
6
 
   files=( "$@" );
7
 
fi
8
 
 
9
 
if [ -f 'hacking.py' ]
10
 
then
11
 
    base=`pwd`
12
 
else
13
 
    base=`pwd`/tools/
14
 
fi
15
 
 
16
 
IGNORE="E501" # Line too long (these are caught by pylint)
17
 
 
18
 
# King Arthur: Be quiet! ... Be Quiet! I Order You to Be Quiet.
19
 
IGNORE="$IGNORE,E121" # Continuation line indentation is not a multiple of four
20
 
IGNORE="$IGNORE,E123" # Closing bracket does not match indentation of opening bracket's line
21
 
IGNORE="$IGNORE,E124" # Closing bracket missing visual indentation
22
 
IGNORE="$IGNORE,E125" # Continuation line does not distinguish itself from next logical line
23
 
IGNORE="$IGNORE,E126" # Continuation line over-indented for hanging indent
24
 
IGNORE="$IGNORE,E127" # Continuation line over-indented for visual indent
25
 
IGNORE="$IGNORE,E128" # Continuation line under-indented for visual indent
26
 
IGNORE="$IGNORE,E502" # The backslash is redundant between brackets
27
 
 
28
 
cmd=(
29
 
    ${base}/hacking.py
30
 
 
31
 
    --ignore="$IGNORE"
32
 
 
33
 
    "${files[@]}"
34
 
)
35
 
 
36
 
echo -e "\nRunning 'cloudinit' pep8:"
37
 
echo "${cmd[@]}"
38
 
"${cmd[@]}"