8000 Document docstring requirements with examples by tpdorsey · Pull Request #6081 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

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
@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.

3 participants

0