mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
20 lines
726 B
Bash
20 lines
726 B
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# Copyright (c) 2018 The Bitcoin Core developers
|
||
|
# Distributed under the MIT software license, see the accompanying
|
||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||
|
#
|
||
|
# Make sure we explicitly open all text files using UTF-8 (or ASCII) encoding to
|
||
|
# avoid potential issues on the BSDs where the locale is not always set.
|
||
|
|
||
|
EXIT_CODE=0
|
||
|
OUTPUT=$(git grep " open(" -- "*.py" | grep -vE "encoding=.(ascii|utf8|utf-8)." | grep -vE "open\([^,]*, ['\"][^'\"]*b[^'\"]*['\"]")
|
||
|
if [[ ${OUTPUT} != "" ]]; then
|
||
|
echo "Python's open(...) seems to be used to open text files without explicitly"
|
||
|
echo "specifying encoding=\"utf8\":"
|
||
|
echo
|
||
|
echo "${OUTPUT}"
|
||
|
EXIT_CODE=1
|
||
|
fi
|
||
|
exit ${EXIT_CODE}
|