Skip to content

Format docstrings in a consistent style #7510

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

Merged
merged 2 commits into from
Aug 1, 2020

Conversation

bluetech
Copy link
Member

@bluetech bluetech commented Jul 17, 2020

This PR updates the docstrings (and some comments) in src/ to use a more consistent style as discussed in #7471.

The second commit documents this in CONTRIBUTING.rst.

The diff is very large and probably pretty boring to review in full, but you can sample it to get the idea. I tried not to make any material changes to the text, but sometimes couldn't resist some very minor improvements.

Fixes #7471. (@aklajnert suggestion to use sphinx-autodoc-typehints will come up in a future PR if it goes well)

point.
"""
"""Parses and returns a namespace object with known arguments at this
point."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could/should use imperative mood (also below).
pydocstyle would have caught this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. So I ran pydocstyle now, and fixes issues that came up: 3b6eeda

It does seem useful, if we only include some error codes (unfortunately the imperative mood one has too many false positives). I will probably send a PR to add it, but since it also requires fixes to docstrings in testing/ I will leave it to a separate PR.

@bluetech bluetech force-pushed the docstrings branch 2 times, most recently from 80bc88e to c9d865a Compare July 18, 2020 10:36
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

I did not check every docstring thoroughly, but gave a cursory glance and things seem to be in order.

The important part to me here is setting the standard, the rest is icing on the cake. 😁

@bluetech bluetech merged commit 49827ad into pytest-dev:master Aug 1, 2020
@bluetech
Copy link
Member Author

bluetech commented Aug 1, 2020

Thanks for reviewing @nicoddemus!

As mentioned in a comment above, a followup adding pydocstyle is coming.

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

Successfully merging this pull request may close these issues.

Preferred docstring style
3 participants