Files
rk35xx-android14/external/bcc/scripts/py-style-check.sh
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

18 lines
558 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# TODO: stop ignoring this. Maybe autopep8 existing stuff?
find tools -type f -name "*.py" | xargs pycodestyle -r --show-source --ignore=E123,E125,E126,E127,E128,E302 || \
echo "pycodestyle run failed, please fix it" >&2
NO_PROPER_SHEBANG="$(find tools examples -type f -executable -name '*.py' | xargs grep -L '#!/usr/bin/python')"
if [ -n "$NO_PROPER_SHEBANG" ]; then
echo "bad shebangs found:"
echo "$NO_PROPER_SHEBANG"
echo
echo "either add proper shebang or remove executable bit" >&2
exit 1
fi