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




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

    ci: Add checks for documentation issues

 .gitlab-ci.yml           |  7 +++++++
 .gitlab-ci/check-docs.py | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e09c998..9553c9fb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -59,8 +59,15 @@ reference:
     - mv _build/docs/reference/html/ _reference/
   artifacts:
     paths:
+      - _build/docs/reference/libsoup-3.0-*.txt
       - _reference
 
+reference-check:
+  stage: docs
+  script:
+    - .gitlab-ci/check-docs.py
+  coverage: '/^([\d.]+%) symbol docs coverage.\s+/'
+
 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..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]