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

Only generate when there are services #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

rami-lv
Copy link

@rami-lv rami-lv commented Apr 17, 2023

Problem

When using the protoc --twirpy_out command to generate Python Twirp API code, the plugin generates an empty file for every .proto file dependency that has no services defined. This behavior can be inconvenient and confusing, especially in large projects where many proto files are present.

Proposed Solution

To address this issue, this PR proposes modifying the plugin to only run the twirpy generator if the .proto file contains services. If a file does not define any services, the plugin will skip generating any code for that file.

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.

1 participant