diff options
| author | MarcoFalke <[email protected]> | 2018-06-06 09:17:52 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2018-06-06 09:17:55 -0400 |
| commit | e4082d59f53d25ccafb96fc829cadbdd13b25b16 (patch) | |
| tree | 156f22bdc7275c0875b1895ed60905ec6bd185d6 | |
| parent | Merge #13288: rpc: Remove the need to include rpc/blockchain.cpp in order to ... (diff) | |
| parent | lint: Add linter to error on #include <*.cpp> (diff) | |
| download | discoin-e4082d59f53d25ccafb96fc829cadbdd13b25b16.tar.xz discoin-e4082d59f53d25ccafb96fc829cadbdd13b25b16.zip | |
Merge #13301: lint: Add linter to error on #include <*.cpp>
9d6c9dbb88 lint: Add linter to error on #include <*.cpp> (Ben Woosley)
Pull request description:
Files should depend on one another by interface, not by implementation.
This checks for quoted includes as well.
Tree-SHA512: d36d468f48d538077f5f927b9561729fd7d76319f6b2e2cc10414a9f243588194e90ca1d85eca65019f9259268f555d25106eaaa56da28c58fa8d5837b469661
| -rwxr-xr-x | test/lint/lint-includes.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index 7cab0ca4d..2c3456b64 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -33,6 +33,14 @@ for CPP_FILE in $(filter_suffix cpp); do fi done +INCLUDED_CPP_FILES=$(git grep -E "^#include [<\"][^>\"]+\.cpp[>\"]" -- "*.cpp" "*.h") +if [[ ${INCLUDED_CPP_FILES} != "" ]]; then + echo "The following files #include .cpp files:" + echo "${INCLUDED_CPP_FILES}" + echo + EXIT_CODE=1 +fi + EXPECTED_BOOST_INCLUDES=( boost/algorithm/string.hpp boost/algorithm/string/case_conv.hpp |