[retro-gtk/header-fixes: 1/2] ci: Check that private headers remain private



commit 9d14a0b5d693b90980cb09a4ac48289f7925a9be
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sat Jan 11 15:41:32 2020 +0100

    ci: Check that private headers remain private
    
    This will check we don't accidentally add private headers to public
    ones, exposing their API publicly.

 .gitlab-ci.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4462fbc..e05b1b5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,8 +1,19 @@
 stages:
+  - lint
   - build
   - test
   - review
 
+api-visibility:
+  stage: lint
+  script:
+    # Check that private headers aren't included in public ones.
+    - if grep "include.*private.h" $(ls retro-gtk/*.h | grep -v private);
+      then \
+        echo "Private headers shouldn't be included in public ones.";
+        exit 1;
+      fi
+
 variables:
   BUNDLE: "retro-demo-samples-test-git.flatpak"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]