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

Make skip-empty the default behavior and remove option #40

Merged
merged 6 commits into from
May 28, 2024

Conversation

darronschall
Copy link
Contributor

@darronschall darronschall commented May 28, 2024

The default behavior of the protoc-gen-twirp_ruby go module is to generate empty scaffolding files for .proto files that do not contain any services. We chose to make our plugin behave similarly, for easier migration / backwards compatibility.

We then introduced the skip-empty flag opt-in to avoid generating those empty files, in #21.

At this point, we're ready to remove the flag and make this the default behavior. It's common for other twirp generators to do the same, see protoc-gen-twirp_typescript, protoc-gen-twirp-java, and protoc-gen-twirp_cpp.

Since the flag is removed as part of this change, passing it on the command line with cause the plugin to error. The path forward is to simply remove --twirp_ruby_opt=skip-empty from the command line if present.

The plugin never generates empty scaffolding anymore. As such, we no longer need our custom matcher to validate the empty scaffolding content.
This is now the default behavior.
@darronschall
Copy link
Contributor Author

@danielmorrison I opted for a "safe" deprecation by introducing a warning this release if the flag is still present on the command line, and then error next release. I'm not entirely sure we need to do that. You could easily convince me to skip the warning altogether and just drop the flag entirely here.

Rather than a soft deprecation here over two releases, we remove recognizing the flag entirely.

The migration path is small/easy for this change (updating the command to simply remove the option), and we don't have a very large user base at the moment.
@darronschall darronschall changed the title Make skip-empty the default behavior and deprecate option Make skip-empty the default behavior and remove option May 28, 2024
@darronschall
Copy link
Contributor Author

After consideration, decided to remove the flag entirely. The migration is simple.

@darronschall darronschall merged commit 739e63f into main May 28, 2024
5 checks passed
@darronschall darronschall deleted the make-skip-empty-the-default-and-remove-flag branch May 28, 2024 17:14
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