[libsoup/pgriffis/ci-test] ci: Add checks for documentation issues




commit 0a005bcb3ee0739b6f453578b9787705d980bd12
Author: Patrick Griffis <pgriffis igalia com>
Date:   Fri Oct 30 15:38:33 2020 -0500

    ci: Add checks for documentation issues

 .gitlab-ci.yml           |  5 +++++
 .gitlab-ci/check-docs.py | 26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e09c998..d57d38b1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -61,6 +61,11 @@ reference:
     paths:
       - _reference
 
+reference-check:
+  stage: docs
+  script:
+    - .gitlab-ci/check-docs.py
+
 pages:
   stage: deploy
   needs: ['reference']
diff --git a/.gitlab-ci/check-docs.py b/.gitlab-ci/check-docs.py
new file mode 100755
index 00000000..93656c3a
--- /dev/null
+++ b/.gitlab-ci/check-docs.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+
+import sys
+
+try:
+    with open('_build/docs/reference/libsoup-3.0-unused.txt') as f:
+        unused_docs = f.read()
+except FileNotFoundError:
+    unused_docs = None
+
+if unused_docs:
+    print('There is documentation not listed in libsoup-3.0-sections.txt:')
+    print(unused_docs)
+    sys.exit(1)
+
+with open('_build/docs/reference/libsoup-3.0-undocumented.txt') as f:
+    # The file starts with a summary
+    # undocumented_summary = ''.join(f.readline() for i in range(6)).strip()
+    for i in range(5):
+        f.readline()
+    undocumented_list = f.read().strip()
+
+if undocumented_list:
+    print('There is missing documentation:')
+    print(undocumented_list)
+    sys.exit(1)


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