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




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

    ci: Add checks for documentation issues

 .gitlab-ci.yml           | 12 ++++++++++++
 .gitlab-ci/check-docs.py | 24 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e09c998..dfbf2ad2 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:
@@ -59,8 +60,19 @@ reference:
     - mv _build/docs/reference/html/ _reference/
   artifacts:
     paths:
+      - _build/docs/reference/libsoup-3.0-*.txt
       - _reference
 
+reference-check:
+  stage: docs
+  dependencies: [reference]
+  script:
+    - .gitlab-ci/check-docs.py
+  artifacts:
+    paths:
+      - _build/docs/reference/libsoup-3.0-*.txt
+  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]