aboutsummaryrefslogtreecommitdiff
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-10-09 12:15:38 -0400
committerMarkus Armbruster <armbru@redhat.com>2020-10-10 11:37:48 +0200
commit1cc7398dfa30fffbb23b79ff7cacea18b3c9b674 (patch)
treecd9a894a608a70e1b730f5dd746db4e5be5926b5 /scripts/coccinelle
parentd646b2a128391293f9a9b5924d0b62149f992496 (diff)
qapi/common.py: Convert comments into docstrings, and elaborate
As docstrings, they'll show up in documentation and IDE help. The docstring style being targeted is the Sphinx documentation style. Sphinx uses an extension of ReST with "domains". We use the (implicit) Python domain, which supports a number of custom "info fields". Those info fields are documented here: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists Primarily, we use `:param X: descr`, `:return[s]: descr`, and `:raise[s] Z: when`. Everything else is the Sphinx dialect of ReST. (No, nothing checks or enforces this style that I am aware of. Sphinx either chokes or succeeds, but does not enforce a standard of what is otherwise inside the docstring. Pycharm does highlight when your param fields are not aligned with the actual fields present. It does not highlight missing return or exception statements. There is no existing style guide I am aware of that covers a standard for a minimally acceptable docstring. I am debating writing one.) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-17-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/coccinelle')
0 files changed, 0 insertions, 0 deletions