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

Use per-edition feature defaults instead of syntax type to control behavior. #477

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

chungyc
Copy link
Member

@chungyc chungyc commented Oct 1, 2024

This basically replaces SyntaxType distinguishing between proto2 and proto3 with FeatureSet controlling individual features in Protobuf Editions. For example, instead of checking whether the syntax is proto3 when determining whether repeated fields should use packed encoding by default, we check whether features.repeated_field_encoding is PACKED. The default feature set compatible with proto2 and proto3 are provided by protoc and included in Data.ProtoLens.Compiler.Defaults. The existing tests continue to pass, showing that the features have been determined correctly.

This does not complete support for Protobuf Editions. This requires the ability to override options in certain scopes, e.g., file scope or field scope, which will be added in https://github.com/chungyc/proto-lens/pull/8.

This is the second to last change required for #468.

@chungyc
Copy link
Member Author

chungyc commented Oct 1, 2024

If you want to take a look, @agrue, here is the next change.

@agrue
Copy link
Contributor

agrue commented Oct 2, 2024

Thank you.

@agrue agrue merged commit 77d103a into google:master Oct 2, 2024
11 checks passed
@chungyc chungyc deleted the edition-behavior-incremental branch October 2, 2024 22:49
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