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

Document docstring requirements with examples #6081

Merged
merged 1 commit into from Jun 11, 2023
Merged

Conversation

tpdorsey
Copy link
Contributor

@tpdorsey tpdorsey commented Jun 11, 2023

Updates contribution guide with details on docstring requirements.

Change Summary

  • Reorganize "Documentation style" contribution guidelines with details on docstring style and linting.
  • Provide examples of correct docstrings
  • Add ignore_init_summary: true and merge_init_into_class: true configuration. This will enable correct documentation of class vs instance attributes -- instance attributes should be documented in __init__, and mkdocstrings will pull this into the class documentation. See https://mkdocstrings.github.io/python/usage/configuration/docstrings/#merge_init_into_class for background.

The merge_init_into_class: true configuration change does not affect API documentation currently, but enables documenting instance attributes correctly in future PRs.

Related issue number

Closes DOC-4
Closes DOC-5

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @adriangb

@linear
Copy link

linear bot commented Jun 11, 2023

DOC-5 Establish and document internal module docstring requirements

And add them to the contribution guidelines

DOC-4 Establish and document public module docstring requirements

And add them to the contribution guidelines

@tpdorsey
Copy link
Contributor Author

Please review

@tpdorsey tpdorsey merged commit f3156df into main Jun 11, 2023
53 checks passed
@tpdorsey tpdorsey deleted the doc-style-guide branch June 11, 2023 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants