diff options
Diffstat (limited to 'test/lint')
-rwxr-xr-x | test/lint/lint-includes.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index 7cab0ca4d1..b0ba5f63af 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -6,9 +6,12 @@ # # Check for duplicate includes. # Guard against accidental introduction of new Boost dependencies. +# Check includes: Check for duplicate includes. Enforce bracket syntax includes. + +IGNORE_REGEXP="/(leveldb|secp256k1|univalue)/" filter_suffix() { - git ls-files | grep -E "^src/.*\.${1}"'$' | grep -Ev "/(leveldb|secp256k1|univalue)/" + git ls-files | grep -E "^src/.*\.${1}"'$' | grep -Ev "${IGNORE_REGEXP}" } EXIT_CODE=0 @@ -97,4 +100,12 @@ for EXPECTED_BOOST_INCLUDE in "${EXPECTED_BOOST_INCLUDES[@]}"; do fi done +QUOTE_SYNTAX_INCLUDES=$(git grep '^#include "' -- "*.cpp" "*.h" | grep -Ev "${IGNORE_REGEXP}") +if [[ ${QUOTE_SYNTAX_INCLUDES} != "" ]]; then + echo "Please use bracket syntax includes (\"#include <foo.h>\") instead of quote syntax includes:" + echo "${QUOTE_SYNTAX_INCLUDES}" + echo + EXIT_CODE=1 +fi + exit ${EXIT_CODE} |