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




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

    ci: Add checks for documentation issues

 .gitlab-ci.yml           |  4 ++++
 .gitlab-ci/check-docs.py | 24 ++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e09c998..b10e759d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -37,6 +37,7 @@ fedora-meson-x86_64:
 
 coverage:
   stage: coverage
+  needs: [fedora-meson-x86_64]
   except:
     - tags
   artifacts:
@@ -57,9 +58,12 @@ reference:
     # FIXME: ninja -C _build libsoup-3.0-doc fails
     - ninja -C _build install
     - mv _build/docs/reference/html/ _reference/
+    - .gitlab-ci/check-docs.py
   artifacts:
     paths:
+      - _build/docs/reference/libsoup-3.0-*.txt
       - _reference
+  coverage: '/^([\d]+\%) symbol docs coverage\.\s+/'
 
 pages:
   stage: deploy
diff --git a/.gitlab-ci/check-docs.py b/.gitlab-ci/check-docs.py
new file mode 100755
index 00000000..d36a64fd
--- /dev/null
+++ b/.gitlab-ci/check-docs.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+import sys
+
+with open('_build/docs/reference/libsoup-3.0-unused.txt') as f:
+    unused_docs = f.read()
+
+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()
+    print(f.readline()) # e.g. 95% symbol docs coverage.
+    for i in range(4):
+        f.readline()
+    undocumented_list = f.read().strip()
+
+if undocumented_list:
+    print('There is missing documentation for these symbols:')
+    print(undocumented_list)
+    # sys.exit(1)


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