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

add nested package declaration #29

Merged
merged 2 commits into from
Mar 26, 2024
Merged

add nested package declaration #29

merged 2 commits into from
Mar 26, 2024

Conversation

colinbendell
Copy link
Contributor

@colinbendell colinbendell commented Mar 22, 2024

Fixes Issue #26 with a poorman's version of indent prettier

@colinbendell colinbendell changed the title add nested package declaration and simple indent prittification add nested package declaration Mar 22, 2024
@maximecb maximecb requested a review from tenderworks March 25, 2024 19:09
@tenderworks
Copy link
Contributor

Seems good, thank you!

I don't like that we have indentation / formatting code strewn around, and I was thinking about maybe using Prism to "prettify" the output Ruby. Then we don't need to care so much about indentation. WDYT?

@tenderworks tenderworks merged commit 3e15537 into main Mar 26, 2024
4 checks passed
@maximecb
Copy link
Contributor

I was thinking about maybe using Prism to "prettify" the output Ruby. Then we don't need to care so much about indentation. WDYT?

Open to it, but I'd rather not depend on external gems if we can avoid it?

@maximecb maximecb deleted the cb_add_package_indent branch March 26, 2024 19:50
@tenderworks
Copy link
Contributor

Open to it, but I'd rather not depend on external gems if we can avoid it?

Ya, I'd also prefer not to depend on external gems, but the generated code won't depend on anything. For now I think we should just treat indentation as "best effort". IOW lets fix what we can, but not worry about it if it gets too hard.

Another option is that folks could make code formatting part of their compilation process. I'm imagining something like:

$ bin/protoboeuf --stdout path/to/some/protoc_file.protoc | prettify > output.rb

@maximecb
Copy link
Contributor

Sure that seems fine. We could also include a prettify.rb script which depends on prism.

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.

3 participants