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



commit 1b88a53332706959a85ba282d878b62a91065319
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..7cf1171 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]