Commit a644f918 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

ci: Check the API visibility

Check we don't accidentally add private headers to public ones, and that
all public headers are included in the public handy.h. We do so by
running the newly added lint/api-visibility.sh script during the build
stage. This script can be run locally too.
parent 12159d98
Pipeline #51168 passed with stages
in 17 minutes and 17 seconds
......@@ -20,6 +20,12 @@ before_script:
meson ${BUILD_OPTS} . _build &&
ninja -C _build
api-visibility:
<<: *tags
stage: build
script:
- lint/api-visibility.sh
build-debian-gcc:
image: debian:buster
<<: *tags
......
#!/bin/bash
# Check that private headers aren't included in public ones.
if grep "include.*private.h" $(find src -name '*\.h' -not -regex '.*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 $(find src -name '*.h' -not -regex '.*private.h' -not -regex '.*/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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment