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

Feature request: protobuf file formatter. #11

Closed
mattbailey opened this issue Dec 18, 2019 · 4 comments
Closed

Feature request: protobuf file formatter. #11

mattbailey opened this issue Dec 18, 2019 · 4 comments

Comments

@mattbailey
Copy link

https://github.com/uber/prototool has updated their readme to redirect users to buf (uber/prototool@71e91a9). Which somewhat implies the eventual death of prototool, which means the death of some features that buf is missing (intentional or not).

buf's current position on formatting proto files is that it's outside of the scope of the tool, or currently more troublesome than the value of the feature: https://buf.build/docs/lint-checkers#formatting

This is a fine position, but I think it's worth tracking an issue against this for whenever someone takes on a "correct" parsing & formatting implementation.

@bufdev
Copy link
Member

bufdev commented Dec 18, 2019

Buf isn’t associated with the Prototool project and doesn’t intend to cover all of Prototool’s various use cases - we have no idea of Prototool’s intended long-term support posture. For reference, here is our reasoning on formatting: https://buf.build/docs/lint-checkers#formatting

@bufdev
Copy link
Member

bufdev commented Dec 18, 2019

Going to close this issue for now - we want to keep zero open issues unless we intend to work on them, and we don’t see a formatter being a priority any time soon. It turns out that FileDescriptorSets are lossy, namely there are situations where leading detached comments are dropped during parsing. It’s not possible to make a 100% correct formatter based on FileDescriptorSets, and Buf is FileDescriptorSet-based. Prototool uses a third-party Protobuf parser for it’s formatter, which as we discuss in the documentation, leads to other issues.

@bufdev bufdev closed this as completed Dec 18, 2019
@mattbailey
Copy link
Author

That's fine, and I totally understand the reasoning. Even a closed ticket is good.

@bufdev
Copy link
Member

bufdev commented Jan 24, 2021

Just an update: we are working on this, although not high priority, but we should have something out in the future.

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

No branches or pull requests

2 participants