criccomini / proto-schema-parser

A Pure Python Protobuf Parser
MIT License
38 stars 20 forks source link

Accept comments in service and method definitions #17

Closed paskozdilar closed 7 months ago

paskozdilar commented 7 months ago

This PR parses comments inside Service and Method definitions properly.

It achieves that by adding commentDecl as an additional type of serviceElement and methodElement, and adds a unit test to verify that.

paskozdilar commented 7 months ago

I've also noticed this PR fixes half of the issue #16 - the other half is a little harder, since it would require supporting options with complex values.

This seemed significantly harder to do, and it was outside of my use case, so I didn't do it.

criccomini commented 7 months ago

@paskozdilar This looks great. Mind fixing the codestyle issues? I can merge it in then.

Also, curious: what're you using proto-schema-parser for? I'm trying to gather use cases for it. :)

paskozdilar commented 7 months ago

Mind fixing the codestyle issues?

Done.

Also, curious: what're you using proto-schema-parser for?

I have a bunch of .proto files which contain comments explaining how the services work. I want to extract them to Markdown format so it can be used with documentation generators such as MkDocs and Sphinx.

This seemed like a good tool for achieving that :)

criccomini commented 7 months ago

Merged and released to 1.3.0! Thanks. :)

https://pypi.org/project/proto-schema-parser/1.3.0/