Skip to content
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

Improve docs for PulpObject and other attrs classes #24

Open
rohanpm opened this issue Jun 25, 2019 · 0 comments
Open

Improve docs for PulpObject and other attrs classes #24

rohanpm opened this issue Jun 25, 2019 · 0 comments

Comments

@rohanpm
Copy link
Member

rohanpm commented Jun 25, 2019

Summary

It would be nice if documentation of attributes on PulpObject subclasses, and other attrs-based classes, was improved with respect to the type and default value of attributes.

Issue Type

  • Feature Request

Current behavior

If I look at generated docs e.g. at https://release-engineering.github.io/pubtools-pulplib/api/model.html, I see attribute docs like this:

is_sigstore = None
True if this is a sigstore repository, used for container image manifest signatures.

signing_keys = None
A list of GPG signing key IDs used to sign content in this repository.

Where:

  • the type of each attribute isn't clearly documented - it depends on the developer explicitly writing it in the doc string for the attribute (which can be easily forgotten)
  • every single attribute has this trailing "= None", which is useless - one might think it means the default value is None so it can be omitted from calls to the constructor, but actually it's displayed even for attributes which are mandatory to provide with a non-None value.

Desired behavior

Attribute docs don't have the useless "= None" suffix, and they display the attribute type and possibly even a default value in some standardized way.

For example:

is_sigstore: bool
True if this is a sigstore repository, used for container image manifest signatures.

signing_keys: List[str] = []
GPG signing key IDs used to sign content in this repository.

Use case

Allows developers to more clearly understand expected type of all attributes, and cuts down on useless noise in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant