diff --git a/doc/developer-notes.md b/doc/developer-notes.md index e7df0cc53..8547e1136 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -249,12 +249,12 @@ Strings and formatting ------------------------ - Avoid using locale dependent functions if possible. You can use the provided - [`lint-locale-dependence.sh`](/contrib/devtools/lint-locale-dependence.sh) - to check for accidental use of locale dependent functions. + [`lint-locale-dependence.sh`](../test/lint/lint-locale-dependence.sh) + to check for accidental use of locale-dependent functions. - *Rationale*: Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. - - These functions are known to be locale dependent: + - These functions are known to be locale-dependent: `alphasort`, `asctime`, `asprintf`, `atof`, `atoi`, `atol`, `atoll`, `atoq`, `btowc`, `ctime`, `dprintf`, `fgetwc`, `fgetws`, `fprintf`, `fputwc`, `fputws`, `fscanf`, `fwprintf`, `getdate`, `getwc`, `getwchar`, `isalnum`, diff --git a/test/lint/lint-all.sh b/test/lint/lint-all.sh index fabc24c91..8d6ed8e4b 100755 --- a/test/lint/lint-all.sh +++ b/test/lint/lint-all.sh @@ -7,7 +7,7 @@ # This script runs all contrib/devtools/lint-*.sh files, and fails if any exit # with a non-zero status code. -# This script is intentionally locale dependent by not setting "export LC_ALL=C" +# This script is intentionally locale-dependent by not setting "export LC_ALL=C". # in order to allow for the executed lint scripts to opt in or opt out of locale # dependence themselves. diff --git a/test/lint/lint-locale-dependence.sh b/test/lint/lint-locale-dependence.sh index cb60006cf..ea887020f 100755 --- a/test/lint/lint-locale-dependence.sh +++ b/test/lint/lint-locale-dependence.sh @@ -221,7 +221,7 @@ for LOCALE_DEPENDENT_FUNCTION in "${LOCALE_DEPENDENT_FUNCTIONS[@]}"; do done if [[ ${EXIT_CODE} != 0 ]]; then echo "Unnecessary locale dependence can cause bugs that are very" - echo "tricky to isolate and fix. Please avoid using locale dependent" + echo "tricky to isolate and fix. Please avoid using locale-dependent" echo "functions if possible." echo echo "Advice not applicable in this specific case? Add an exception" diff --git a/test/lint/lint-shell-locale.sh b/test/lint/lint-shell-locale.sh index cbb15d499..f4ef7698a 100755 --- a/test/lint/lint-shell-locale.sh +++ b/test/lint/lint-shell-locale.sh @@ -13,7 +13,7 @@ export LC_ALL=C EXIT_CODE=0 for SHELL_SCRIPT in $(git ls-files -- "*.sh" | grep -vE "src/(secp256k1|univalue)/"); do - if grep -q "# This script is intentionally locale dependent by not setting \"export LC_ALL=C\"" "${SHELL_SCRIPT}"; then + if grep -q "# This script is intentionally locale-dependent by not setting \"export LC_ALL=C\"." "${SHELL_SCRIPT}"; then continue fi FIRST_NON_COMMENT_LINE=$(grep -vE '^(#.*)?$' "${SHELL_SCRIPT}" | head -1)