diff options
Diffstat (limited to '')
-rwxr-xr-x | subprojects/libhandy/lint/api-visibility.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/subprojects/libhandy/lint/api-visibility.sh b/subprojects/libhandy/lint/api-visibility.sh new file mode 100755 index 0000000..ce8e7f5 --- /dev/null +++ b/subprojects/libhandy/lint/api-visibility.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Check that private headers aren't included in public ones. +if grep "include.*private.h" $(ls src/*.h | grep -v "private.h"); +then + echo "Private headers shouldn't be included in public ones." + exit 1 +fi + +# Check that handy.h contains all the public headers. +for header in $(ls src | grep "\.h$" | grep -v "private.h" | grep -v handy.h); +do + if ! grep -q "$(basename $header)" src/handy.h; + then + echo "The public header" $(basename $header) "should be included in handy.h." + exit 1 + fi +done |