Skip to content

Commit

Permalink
use export LC_ALL=C.UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
scravy authored and str4d committed Oct 27, 2020
1 parent b90433a commit 52f45ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/lint/lint-shell-locale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Make sure all shell scripts:
# a.) explicitly opt out of locale dependence using "export LC_ALL=C", or
# a.) explicitly opt out of locale dependence using
# "export LC_ALL=C" or "export LC_ALL=C.UTF-8", or
# b.) explicitly opt in to locale dependence using the annotation below.

export LC_ALL=C
Expand All @@ -16,7 +17,7 @@ for SHELL_SCRIPT in $(git ls-files -- "*.sh" | grep -vE "src/(secp256k1|univalue
continue
fi
FIRST_NON_COMMENT_LINE=$(grep -vE '^(#.*|)$' "${SHELL_SCRIPT}" | head -1)
if [[ ${FIRST_NON_COMMENT_LINE} != "export LC_ALL=C" ]]; then
if [[ ${FIRST_NON_COMMENT_LINE} != "export LC_ALL=C" && ${FIRST_NON_COMMENT_LINE} != "export LC_ALL=C.UTF-8" ]]; then
echo "Missing \"export LC_ALL=C\" (to avoid locale dependence) as first non-comment non-empty line in ${SHELL_SCRIPT}"
EXIT_CODE=1
fi
Expand Down

0 comments on commit 52f45ad

Please sign in to comment.