Skip to content

Add disable_comments option#1127

Merged
LucioFranco merged 3 commits intohyperium:masterfrom
bouzuya:disable-comments
Nov 8, 2022
Merged

Add disable_comments option#1127
LucioFranco merged 3 commits intohyperium:masterfrom
bouzuya:disable-comments

Conversation

@bouzuya
Copy link
Contributor

@bouzuya bouzuya commented Oct 30, 2022

Motivation

In prost-build's Configurations, there is a disable_comments. This disables the generation of comments in proto as documentation comments. However, it only works for message and its fields, not service and its rpc.

This Pull Request adds similar functionality to tonic-build's Configurations.

Solution

@bouzuya
Copy link
Contributor Author

bouzuya commented Nov 4, 2022

I'll fix it later.

@bouzuya
Copy link
Contributor Author

bouzuya commented Nov 5, 2022

I rebased and fixed the conflicts and tests.

I didn't try it on ubuntu-latest, so it might fail.

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

LGTM just would like to see the generated code go into the OUT_DIR rather than commited into the folder.

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

Comment on lines +224 to +229
let method_doc = if disable_comments.contains(&format!(
"{}{}{}.{}",
package,
if package.is_empty() { "" } else { "." },
service.identifier(),
method.identifier()
Copy link
Member

Choose a reason for hiding this comment

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

For a follow up PR if you have time would be good to move these to a fn to centralize the impl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have created a draft PR. #1144

@LucioFranco LucioFranco merged commit e188521 into hyperium:master Nov 8, 2022
@bouzuya bouzuya mentioned this pull request Nov 9, 2022
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.

2 participants