summaryrefslogtreecommitdiff
path: root/tools/run-pep8
blob: e7707985e865a56acb5aba2b094c037fc399fc78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

ci_files='cloud*.py cloudinit/*.py cloudinit/config/*.py'
test_files=$(find tests -name "*.py")
def_files="$ci_files $test_files"

if [ $# -eq 0 ]; then
   files=( )
   for f in $def_files; do
      [ -f "$f" ] || { echo "failed, $f not a file" 1>&2; exit 1; }
      files[${#files[@]}]=${f}
   done
else
   files=( "$@" );
fi 

cmd=(
    pep8

    --ignore=E501 # Line too long (these are caught by pylint)

    "${files[@]}"
)

echo -e "\nRunning pep8:"
echo "${cmd[@]}"
"${cmd[@]}"