docs: add make docs
target to generate inheritance/call graphs via Doxygen
#1484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a
make docs
target to generate Doxygen documentation from Python sources and docstrings. After #1452 (comment), my particular interest here is in its class-inheritance and function-call graphs.User story: As a developer, I want to be able to see diagrams of the call/caller relationships among functions and the inheritance relationships among classes, so that I can explore (and observe architectural smells in) the codebase visually.
If we ever were to publish this kind of documentation—for example, for
securedrop-sdk
—we'd probably go with Sphinx as the default in the Python ecosystem. I went with Doxygen here because it has built-in support for generating (the Graphviz source for) these graphs, whereas Sphinx requires an extension like Pyan. For an optional development tool, my weak preference is for (a)apt install doxygen graphviz
over (b)pip install sphinx pyan3
which depends onapt install graphviz
anyway.Test Plan
On this branch:
make docs
fails gracefully without Doxygen installed.sudo apt install doxygen
make docs
fails gracefully without Graphviz installed.sudo apt install graphviz
make docs
succeeds, including underlyingdot
invocations.securedrop_client
→api_jobs
→base
→ApiJob
shows:ApiJob
subclasses; andApiJob
→QueueJob
→QObject
.Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:
If these changes modify the database schema, you should include a database migration. Please check as applicable:
main
and confirmed that the migration applies cleanlymain
and would like the reviewer to do so