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

cargo-fmt should format tests by default #803

Closed
kamalmarhubi opened this issue Feb 2, 2016 · 5 comments
Closed

cargo-fmt should format tests by default #803

kamalmarhubi opened this issue Feb 2, 2016 · 5 comments

Comments

@kamalmarhubi
Copy link
Contributor

Right now it'll only format the library and binary. You have to run rustfmt on the test source files directly to get tests.

@kamalmarhubi kamalmarhubi changed the title cargo-fmt should format tests and binaries by default cargo-fmt should format tests by default Feb 2, 2016
@andybarron
Copy link

+1 to this, yes please!

Zarokka pushed a commit to Zarokka/rustfmt that referenced this issue Nov 6, 2016
@Zarokka
Copy link

Zarokka commented Nov 6, 2016

I prepared a fix for this Zarokka@08b17ef

but then I saw that PR #1206 seems to address this in a broader way
this is also related to #1126

@conradkleinespel
Copy link

I just tested this and it now seems to work as expected: code in tests/*.rs is formatted, including code from submodules in tests/**/*.rs that is used in tests/*.rs.

@nrc
Copy link
Member

nrc commented May 16, 2017

Thanks for testing it out!

@dashed
Copy link

dashed commented Sep 24, 2017

This doesn't seem to work anymore as of rustfmt-nightly v0.2.7.

My workaround is: cargo fmt -- ./tests/**/*.rs

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

6 participants