Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

feat: buf format via stdin #1021

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

Conversation

choplin
Copy link

@choplin choplin commented Aug 18, 2022

buf now support format files via stdin.

This would be more efficient than the current temp_file settings. (Additionally, temp_file settings don't work out-of-the-box in my environment)

@stefanvanburen
Copy link

I don't think it's supported quite yet - there's an open PR for it though. I'd assume it'll make it out in the next release.

@jose-elias-alvarez
Copy link
Owner

Thanks! Let's wait until the upstream PR has been merged, then we can go ahead and merge this, since I agree it's a big improvement.

@choplin
Copy link
Author

choplin commented Aug 19, 2022

Thanks, everyone! Right, I misunderstood the buf behavior. Although this PR worked for me as expected, it didn't format input from stdin but format all proto files on the project defined with buf.yaml and buf.work.yaml. Since the rest proto files were already formatted, it looked to format only the file being edited.

By the way, I added the --stdin flag for bufbuild/buf#1345. I'd be happy if this would be merged when bufbuild/buf#1345 is merged and released.

@choplin
Copy link
Author

choplin commented Aug 19, 2022

I'll watch bufbuild/buf#1345, and let you know when it's released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants