-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: standardize how we refer to methods in docstrings #1595
Comments
+1 for double back-ticks. Note to myself: Add a corresponding line to https://github.com/secure-systems-lab/code-style-guidelines/blob/master/python.md#docstrings. |
I didn't specify the argument names in function docstrings, which is probably the most common case... but maybe the same applies in that case: when argument names are used in the docstring, use double-backticks to get the |
Not sure I understand. Where did you not specify them? Above you do say "...ways to refer to methods, objects and arguments...". At any rate, I think it's fine to use double-backticks for all of these, unless it turns out they clutter the docstrings in code or when rendered on RTD. |
oops, so I did :) carry on then |
Current behavior:
Currently we use several different ways to refer to methods, objects and arguments in the Metadata API and ngclient docstrings. Examples:
This has been partially on purpose to see what these all look like (both in published docs and in code).
Expected behavior:
Ideally we should be consistent and follow the coding style guidelines (which somewhat reasonably argue against the sphinx links). The chosen method should be useful in the published docs and not ruin the docstring readability in source code. We'd want to apply the style in docstrings in
tuf/api/
andtuf/ngclient/
(as those are used to produce the ReadTheDocs api docs).After seeing all options I think I lean on using
``refresh()``
: it creates a distinct rendering on ReadTheDocs and does not ruin the docstring readability in source code like the sphinx link format does. It does not create a clickable link but usually docstring text does not need that.#1590 has many examples of using this format.
The text was updated successfully, but these errors were encountered: