mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
Enforce the use of bracket syntax includes ("#include <foo.h>")
This commit is contained in:
parent
906bee8e5f
commit
6d10f43738
1 changed files with 12 additions and 1 deletions
|
@ -6,9 +6,12 @@
|
||||||
#
|
#
|
||||||
# Check for duplicate includes.
|
# Check for duplicate includes.
|
||||||
# Guard against accidental introduction of new Boost dependencies.
|
# 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() {
|
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
|
EXIT_CODE=0
|
||||||
|
@ -97,4 +100,12 @@ for EXPECTED_BOOST_INCLUDE in "${EXPECTED_BOOST_INCLUDES[@]}"; do
|
||||||
fi
|
fi
|
||||||
done
|
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}
|
exit ${EXIT_CODE}
|
||||||
|
|
Loading…
Add table
Reference in a new issue