
--ignore was being called with ',E121,E...' rather than 'E121,E...'. that resulted in odd behavior, missing the pep8 errors that are fixed here.
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ $# -eq 0 ]; then
|
|
files=( bin/cloud-init $(find * -name "*.py" -type f) )
|
|
else
|
|
files=( "$@" );
|
|
fi
|
|
|
|
if [ -f 'hacking.py' ]
|
|
then
|
|
base=`pwd`
|
|
else
|
|
base=`pwd`/tools/
|
|
fi
|
|
|
|
IGNORE=""
|
|
|
|
# King Arthur: Be quiet! ... Be Quiet! I Order You to Be Quiet.
|
|
IGNORE="$IGNORE,E121" # Continuation line indentation is not a multiple of four
|
|
IGNORE="$IGNORE,E123" # Closing bracket does not match indentation of opening bracket's line
|
|
IGNORE="$IGNORE,E124" # Closing bracket missing visual indentation
|
|
IGNORE="$IGNORE,E125" # Continuation line does not distinguish itself from next logical line
|
|
IGNORE="$IGNORE,E126" # Continuation line over-indented for hanging indent
|
|
IGNORE="$IGNORE,E127" # Continuation line over-indented for visual indent
|
|
IGNORE="$IGNORE,E128" # Continuation line under-indented for visual indent
|
|
IGNORE="$IGNORE,E502" # The backslash is redundant between brackets
|
|
IGNORE="${IGNORE#,}" # remove the leading ',' added above
|
|
|
|
cmd=(
|
|
${base}/hacking.py
|
|
|
|
--ignore="$IGNORE"
|
|
|
|
"${files[@]}"
|
|
)
|
|
|
|
echo -e "\nRunning 'cloudinit' pep8:"
|
|
echo "${cmd[@]}"
|
|
"${cmd[@]}"
|