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

Allow non_camel_case_types on some codegen structs #296

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

jen20
Copy link
Collaborator

@jen20 jen20 commented Mar 19, 2020

This commit adjusts the code generation for the internal structs in the implementation of Service<http::Request<HyperBody>> for *Server<T> in order to annotate internal structs whose names are derived from gRPC method names with [allow(non_camel_case_types)]. This supresses compiler warnings about type names when compiling generated code. The struct names are not exposed externally, so this has no impact on types seen by library consumers.

Fixes #295.

@jen20 jen20 requested a review from LucioFranco March 19, 2020 17:02
@jen20 jen20 self-assigned this Mar 19, 2020
@jen20 jen20 added C-bug Category: Something isn't working A-build labels Mar 19, 2020
@jen20
Copy link
Collaborator Author

jen20 commented Mar 19, 2020

The CI failures here are unrelated to this change, but do look valid - I'll take a look at fixing them up on a separate PR and rebasing this on top to get a green run before merge.

@LucioFranco
Copy link
Member

@jen20 that would be great, looks like 1.42's deprecation of the old error trait methods. It would be good to fix that thanks 👍

This commit adjusts the code generation for the internal structs in the
implementation of Service<http::Request<HyperBody>> for *Server<T> in
order to annotate internal structs whose names are derived from gRPC
method names with `[allow(non_camel_case_types)]`. This supresses
compiler warnings about type names when compiling generated code. The
struct names are not exposed externally, so this has no impact on types
seen by library consumers.

Fixes #295.
@jen20 jen20 force-pushed the jen20/allow-non-camel-case-internal-structs branch from 79c248a to c594514 Compare March 19, 2020 19:08
@jen20
Copy link
Collaborator Author

jen20 commented Mar 19, 2020

Rebased on top of master now it has the deprecated error trait method handled.

@jen20 jen20 merged commit 224280d into master Mar 19, 2020
@jen20 jen20 deleted the jen20/allow-non-camel-case-internal-structs branch March 19, 2020 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build C-bug Category: Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build warnings in proto defs
2 participants