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

Add disable_comments option #1127

Merged
merged 3 commits into from Nov 8, 2022
Merged

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.

tests/disable_comments/.gitignore Outdated Show resolved Hide resolved
tests/disable_comments/Cargo.toml Outdated Show resolved Hide resolved
tests/disable_comments/Cargo.toml Outdated Show resolved Hide resolved
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.

None yet

2 participants