File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 6
6
#
7
7
# Check for duplicate includes.
8
8
# Guard against accidental introduction of new Boost dependencies.
9
+ # Check includes: Check for duplicate includes. Enforce bracket syntax includes.
10
+
11
+ IGNORE_REGEXP=" /(leveldb|secp256k1|univalue)/"
9
12
10
13
filter_suffix () {
11
- git ls-files | grep -E " ^src/.*\.${1} " ' $' | grep -Ev " /(leveldb|secp256k1|univalue)/ "
14
+ git ls-files | grep -E " ^src/.*\.${1} " ' $' | grep -Ev " ${IGNORE_REGEXP} "
12
15
}
13
16
14
17
EXIT_CODE=0
@@ -97,4 +100,12 @@ for EXPECTED_BOOST_INCLUDE in "${EXPECTED_BOOST_INCLUDES[@]}"; do
97
100
fi
98
101
done
99
102
103
+ QUOTE_SYNTAX_INCLUDES=$( git grep ' ^#include "' -- " *.cpp" " *.h" | grep -Ev " ${IGNORE_REGEXP} " )
104
+ if [[ ${QUOTE_SYNTAX_INCLUDES} != " " ]]; then
105
+ echo " Please use bracket syntax includes (\" #include <foo.h>\" ) instead of quote syntax includes:"
106
+ echo " ${QUOTE_SYNTAX_INCLUDES} "
107
+ echo
108
+ EXIT_CODE=1
109
+ fi
110
+
100
111
exit ${EXIT_CODE}
You can’t perform that action at this time.
0 commit comments