lint: Make sure we read the command line inputs using utf-8 decoding in python

This commit is contained in:
Chun Kuan Lee
2018-09-02 06:40:56 +08:00
parent bdbd654df8
commit 5d62dcf9cf
5 changed files with 20 additions and 12 deletions

View File

@@ -17,4 +17,12 @@ if [[ ${OUTPUT} != "" ]]; then
echo "${OUTPUT}"
EXIT_CODE=1
fi
OUTPUT=$(git grep "check_output(" -- "*.py" | grep "universal_newlines=True" | grep -vE "encoding=.(ascii|utf8|utf-8).")
if [[ ${OUTPUT} != "" ]]; then
echo "Python's check_output(...) seems to be used to get program outputs without explicitly"
echo "specifying encoding=\"utf8\":"
echo
echo "${OUTPUT}"
EXIT_CODE=1
fi
exit ${EXIT_CODE}