-
Notifications
You must be signed in to change notification settings - Fork 925
cargo fmt and cargo fmt --check don't agree on bindgen #3799
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
Comments
STR: Check out rust-lang/rust-bindgen@dd21b21
|
I can reproduce this one as well, though I've no idea what the cause is 🤔 |
When running with the list file names option $ cargo +nightly fmt -- -l
rust-bindgen/src/options.rs
rust-bindgen/tests/../src/options.rs There is a max_width = 80
binop_separator = "back" but also one in the normalize_doc_attributes = true Since rustfmt will run for each target with In the interim, I believe you can get this resolved by adding a https://github.com/rust-lang/rust-bindgen/blob/master/tests/tests.rs#L16 #[rustfmt::skip]
#[path = "../src/options.rs"]
mod options; Alternatively, you could use the same max_width = 80 |
@topecongiro @scampi - is this indeed a bug in rustfmt? Personally I feel the issue is that the same file is being formatted twice, but with two different conflicting config files (one with If it is a bug, is the expectation that rustfmt would somehow know while processing the |
Yeah, that's a good point (sorry, I missed the replies before). I think this can be closed as invalid if you want, though probably a warning or some sort of detection would be useful for this (probably lower priority? Idk). |
I am not really familiar with that part of the code, but that said:
|
Sorry for the late reply. @calebcartwright @scampi This seems like a bug to me. IIRC, the rule to pick the correct rustfmt.toml should be something like the following:
So with respect to this issue, the Also we should not format the same file more than once. Looks like when a module has |
@scampi -
I actually hadn't noticed it before either, but I think the docs here accurately reflect the rules @topecongiro enumerated
That makes sense. IMO, rustfmt is locating and using the correct config files. For the
Sounds like that's the actual bug here 🐞 So IIUC, because src/options.rs is formatted with the invocation of
@scampi - any chance your #3590 PR solves that (Asking based on the PR title)? 🤞 |
@calebcartwright that PR is to handle path attribute in windows. I doubt this would have an impact here ;o( |
This allows us to workaround/fix rust-lang/rustfmt#3799
This allows us to workaround/fix rust-lang/rustfmt#3799
This allows us to workaround/fix rust-lang/rustfmt#3799
This allows us to workaround/fix rust-lang/rustfmt#3799
This allows us to workaround/fix rust-lang/rustfmt#3799
Will put concrete STR in a sec.
The text was updated successfully, but these errors were encountered: