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

fix(python): ensure Raises: section is after Returns: section in google style #194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hassec
Copy link

@hassec hassec commented Aug 5, 2024

Changes google_docstrings.lua template to ensure the Raises: section is after the Returns: section, as is shown in the Google Style Guide

Closes #193

@ColinKennedy
Copy link
Contributor

I don't see anything in Google's styleguide saying that Raises is meant to come beforehand, just a couple examples where it does. Luckily Google does have a way to seek clarification. e.g. in the past I asked + PRed to google/styleguide#505

We've got a custom pylint GoogleDocstringChecker internally that verifies the our style of docstring format. My internal response to this kind of question is generally to defer to whatever our lint checker implementation asks for when it comes to details like this. Running your final example through that, it likes it. Which is a strong indicator that we allow that nice readable form. :)

It'd be good to get confirmation before moving forward with this PR.

@hassec
Copy link
Author

hassec commented Aug 9, 2024

@ColinKennedy let's see if someone from Google replies. Otherwise, I'd argue that w/o guidance, following the Google examples would be the more reasonable default, or make it configurable.

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.

Python: Should Raises be after Return in google style?
2 participants