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

--rustfmt_bindings doesn't work with printing bindings to stdout #968

Closed
fitzgen opened this issue Sep 8, 2017 · 5 comments
Closed

--rustfmt_bindings doesn't work with printing bindings to stdout #968

fitzgen opened this issue Sep 8, 2017 · 5 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Sep 8, 2017

This produces pretty code in output.rs:

$ bindgen input.h --rustfmt-bindings -o output.rs

This does not print pretty code to stdout:

$ bindgen input.h --rustfmt-bindings

See the rustfmt_generated_file function in src/lib.rs for where we currently run rustfmt on generated files. We need to have a version of this for when we are printing to stdout that writes the unformatted bindings to a child rustfmt's stdin, and then pipes the child's stdout to our stdout. We actually have something pretty similar to this in tests/tests.rs as well in the rustfmt function there.

@highfive
Copy link

highfive commented Sep 8, 2017

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@myromeu
Copy link

myromeu commented Sep 16, 2017

Can I pick up this?

@fitzgen
Copy link
Member Author

fitzgen commented Sep 18, 2017

@myromeu all yours! For the record, you can ask the @highfive bot to automatically assign you:

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

Let me know if you have an questions or anything!

@fitzgen
Copy link
Member Author

fitzgen commented Sep 25, 2017

@myromeu making any progress? Anything I can help with?

@fitzgen
Copy link
Member Author

fitzgen commented Oct 31, 2017

Fixed in #1042

@fitzgen fitzgen closed this as completed Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants