dogecoin/test/lint
Wladimir J. van der Laan 5924dadc2f
Merge #13671: Remove the boost/algorithm/string/case_conv.hpp dependency
b193d5a443 Removes the Boost case_conv.hpp dependency. (251)
7a208d9fad Implements custom tolower and toupper functions. (251)
e2ba043b8d Implements ParseNetwork unit test. (251)

Pull request description:

  This pull request removes the `boost/algorithm/string/case_conv.hpp` dependency from the project.

  `boost/algorithm/string/case_conv.hpp` is included for the `boost::to_lower` and `boost::to_upper` template functions.

  We can replace the calls to these functions with straightforward alternative implementations that use the C++ Standard Library, because the functions are called with `std::string` objects that use standard 7-bit ASCII characters as argument.

  The refactored implementation should work without the explicit `static_cast<unsigned char>` cast and `unsigned char` lambda return type. Both have been added defensively and to be explicit. Especially in case of the former, behaviour is undefined (potentially result in a crash) if the `std::toupper` argument is not an `unsigned char`.

  A potential alternative, maybe even preferred, implementation to address the `boost::to_lower` function call in `ParseNetwork(std::string)` could have been:

  ```c++
  if (net == "ipv4" || net == "IPv4") return NET_IPV4;
  if (net == "ipv6" || net == "IPv6") return NET_IPV6;
  ```
  This alternative implementation would however change the external behaviour of `ParseNetwork(std::string)`.

  This pull requests includes a unit test to validate the implementation of `ParseNetwork(std::string)`  prior and after the removal of the `case_conv.hpp` dependency.

  `boost/algorithm/string/case_conv.hpp` has been removed from the `EXPECTED_BOOST_INCLUDES` in `test/lint/lint-includes.sh` because it is no longer required.

Tree-SHA512: d803ae709f2368a3efb223097384a722436955bce0c44a1a5cffd0abb3164be0cce85ba0e9ebd9408166df3f1a95ea0c0d29e3a2534af2fae206c0419d67fde9
2018-08-29 14:59:49 +02:00
..
check-doc.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
check-rpc-mappings.py Merge #13707: tests: Add usage note to check-rpc-mappings.py 2018-08-25 22:41:33 +02:00
commit-script-check.sh Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
git-subtree-check.sh Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
lint-all.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-circular-dependencies.sh lint: Add linter for circular dependencies 2018-07-18 09:11:26 -04:00
lint-filenames.sh Merge #13496: Test: Harden lint-filenames.sh 2018-06-24 18:39:27 +02:00
lint-format-strings.py Make format string linter understand basic template parameter syntax 2018-08-10 17:28:59 +02:00
lint-format-strings.sh Add linting of WalletLogPrintf(...) format strings 2018-08-07 14:57:54 +02:00
lint-include-guards.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-includes.sh Merge #13671: Remove the boost/algorithm/string/case_conv.hpp dependency 2018-08-29 14:59:49 +02:00
lint-locale-dependence.sh Removes the Boost case_conv.hpp dependency. 2018-08-28 18:42:53 +02:00
lint-logs.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python-shebang.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python-utf8-encoding.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python.sh tests: Use explicit imports 2018-08-13 14:13:39 +02:00
lint-qt.sh test: Add lint to prevent SIGNAL/SLOT connect style 2018-08-21 09:43:55 +01:00
lint-shell-locale.sh use export LC_ALL=C.UTF-8 2018-08-27 12:23:25 +02:00
lint-shell.sh fix locale for lint-shell 2018-08-02 14:46:05 +02:00
lint-tests.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-whitespace.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03: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.