Skip to content

Format field comments also as docstrings #304

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 3 commits into from
Jan 26, 2022

Conversation

michaelosthege
Copy link
Contributor

@michaelosthege michaelosthege commented Dec 24, 2021

Thanks for the pointers @Gobot1234 !

I didn't manage to run the tests (poe command not found) and I'm not sure if/how I should generate the code of the project files.
I gotta jump now (christmas dinner..), but please feel free to give additional instructions or take over the branch!

Enjoy the holiday!

PS.: I tested it on my code by generating & installing the Wheel. Looks like in comparison with the current release it puts all classes in __init__.py now? Also FYI: The line from betterproto.grpc.grpclib_server import ServiceBase was unnecessarily included in the generated file.

Closes #303

@Gobot1234
Copy link
Collaborator

Merry christmas,
I have a quick question, does this also apply the same formatting to Enum member comments as I think that would be a good change as well as be consistent with this.

@michaelosthege
Copy link
Contributor Author

Yes - and they were actually not placed correctly.
My edit just takes out the exception that was made for class attributes.

Now I also added line breaks after the docstring to make it easier to read. (I checked with black, but it didn't care about that line break either way.)

class SomeEnum(betterproto.Enum):
    VALUE_A = 0
    """Val 1"""

    VALUE_B = 5
    """Val 2"""

    VALUE_C = 1234
    VALUE_D = 6

@Gobot1234 Gobot1234 requested a review from cetanu December 24, 2021 14:11
@Gobot1234 Gobot1234 mentioned this pull request Dec 29, 2021
3 tasks
@davidmankin
Copy link

I came to github to request the same fix and now I see that it's already implemented in a PR! 🎉

I hope this gets merged before 2.0.0b5 release…

@cetanu cetanu merged commit 9b5594a into danielgtaylor:master Jan 26, 2022
@michaelosthege michaelosthege deleted the iss-303 branch January 27, 2022 08:04
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.

Format field comments as real docstrings
4 participants