bitcoin/test/lint
Wladimir J. van der Laan 5779dc4f76
Merge #13041: build: Add linter checking for accidental introduction of locale dependence
698cfd0811 docs: Mention lint-locale-dependence.sh in developer-notes.md (practicalswift)
0a4ea2f458 build: Add linter for checking accidental locale dependence (practicalswift)

Pull request description:

  This linter will check for code accidentally introducing locale dependencies.

  Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. We should avoid using locale dependent functions if possible.

  Context: https://github.com/bitcoin/bitcoin/pull/12881#issuecomment-378564722

  Example output:

  ```
  $ contrib/devtools/lint-locale-dependence.sh
  The locale dependent function tolower(...) appears to be used:
  src/init.cpp:    if (s[0] == '0' && std::tolower(s[1]) == 'x') {

  Unnecessary locale dependence can cause bugs that are very
  tricky to isolate and fix. Please avoid using locale dependent
  functions if possible.

  Advice not applicable in this specific case? Add an exception
  by updating the ignore list in contrib/devtools/lint-locale-dependence.sh
  ```

  **Note to reviewers:** What is the most appropriate `LOCALE_DEPENDENT_FUNCTIONS` function list? What should be added or removed?

Tree-SHA512: 14e448828804bb02bf59070647e38b52fce120c700c903a4a8472769a2cee5dd529bd3fc182386993cb8720482cf4250b63a0a477db61b941ae4babe5c65025f
2018-06-07 08:56:46 +02:00
..
check-doc.py test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
check-rpc-mappings.py test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
commit-script-check.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
git-subtree-check.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-all.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-include-guards.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-includes.sh lint: Add linter to error on #include <*.cpp> 2018-06-06 02:11:25 -07:00
lint-locale-dependence.sh build: Add linter for checking accidental locale dependence 2018-06-06 08:08:44 +02:00
lint-logs.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-python-shebang.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-python.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-shell.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-tests.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
lint-whitespace.sh test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
README.md test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00

This folder contains lint scripts.

check-doc.py

Check for missing documentation of command line options.

commit-script-check.sh

Verification of scripted diffs.

git-subtree-check.sh

Run this script from the root of the repository to verify that a subtree matches the contents of the commit it claims to have been updated to.

To use, make sure that you have fetched the upstream repository branch in which the subtree is maintained:

Usage: git-subtree-check.sh DIR (COMMIT)

COMMIT may be omitted, in which case HEAD is used.

lint-all.sh

Calls other scripts with the lint- prefix.