aboutsummaryrefslogtreecommitdiff
path: root/tools/check_doc.py
blob: 6066275b275ded6974a4a0a3f7047eeb4552939c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
#
# Arm SCP/MCP Software
# Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""
Check for missing documentation.
This script runs "make doc" and checks for any output on stderr, where the
Doxygen tool outputs any warnings about undocumented components.
"""

import sys
import subprocess


def main():
    print("Checking for undocumented code...")

    result = subprocess.Popen(
        "make doc",
        shell=True,
        stdout=subprocess.DEVNULL,
        stderr=subprocess.PIPE)

    (stdout, stderr) = result.communicate()

    if stderr:
        print(stderr.decode())
        return 1

    print("The codebase is fully documented.")
    return 0


if __name__ == '__main__':
    sys.exit(main())