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

How can I change buf format setting to 4 spaces indent? #2412

Closed
rinarakaki opened this issue Sep 3, 2023 · 5 comments
Closed

How can I change buf format setting to 4 spaces indent? #2412

rinarakaki opened this issue Sep 3, 2023 · 5 comments

Comments

@rinarakaki
Copy link

No description provided.

@bufdev
Copy link
Member

bufdev commented Sep 5, 2023

We don't support customization of the formatter - we believe that there should be exactly one way to format your Protobuf files, and any decision is better than no decision. As such, we went with 2 spaces, which is the majority usage for Protobuf as of now, and will stick with that. Apologies for the hassle.

@bufdev bufdev closed this as completed Sep 5, 2023
@rinarakaki
Copy link
Author

For example, Boston Dynamics API uses 4-space indentation in their protobuf definitions and they state so in their style guide:

@QuantumGhost
Copy link

QuantumGhost commented Oct 20, 2023

We use tab for indentation in protobuf file. This allows every user choose their own indentation size while keeping all protobuf files consistent.

Forcing 2 spaces as indentation size for every user is not ideal. If you really want to make it "Zero configuration", I believe using tab is more appropriate. (same as what the Go team did)

@bufdev
Copy link
Member

bufdev commented Oct 20, 2023

Our opinion is that you should switch to two spaces, which in our experience is what the majority of Protobuf APIs do, and help remove fragmentation in the community.

@polRk
Copy link

polRk commented Oct 17, 2024

@bufdev What should developers who have vision problems and find it difficult to distinguish between two spaces do? Especially for large nested structures?

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

4 participants