-
Notifications
You must be signed in to change notification settings - Fork 889
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
doc: fix instruction about running Rustfmt from source code #5838
Conversation
I also tried I'm not sure what's the most idiomatic way you usually do @calebcartwright |
Thanks for the PR, but the current recommendation of running rustfmt with |
Maybe I was too quick to close this. We probably want to update the recommendation to say Also, @xxchan |
I know cargo run --bin rustfmt works, but I do need a way to run cargo fmt with compiled rustfmt. |
This is also why I wanted to install rustfmt and run cargo +nightly-x fmt.. #5755 |
Got it. Assuming the user hasn't compiled
|
Added the build step, and also mentioned |
Yes 🤣 |
Contributing.md
Outdated
|
||
``` | ||
cargo run --bin cargo-fmt -- --manifest-path path/to/project/you/want2test/Cargo.toml | ||
cargo build --bin rustfmt && RUSTFMT="./target/debug/rustfmt" cargo run --bin cargo-fmt -- --manifest-path path/to/project/you/want2test/Cargo.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this as is (I have run into the current non-ideal behavior myself on occasion, but I haven't heard of anyone else doing so while developing rustfmt)
However, this line is starting to get a bit long. What if we went with the one-liner as your original proposal and just included a note above or below (something to the effect of "you may need to build rustfmt first)"
The audience for these docs are strictly rustfmt developers, and I'm content structuring the docs under the assumption they already know/can easily determine this is one binary invoking another and that a build might be involved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xxchan thanks for helping to improve the docs. If you could rebase on the current master I can go ahead and merge.
`cargo-fmt` uses `rustfmt` from `PATH`, so `cargo run --bin cargo-fmt` still uses installed `rustfmt` instead of built one.
@xxchan If possible could you squash these into a single commit. |
Agreed they should be squashed @ytmimi though just want to note we can also do that on behalf of contributors as part of the merge strategy: |
@calebcartwright appreciate you pointing that out. I knew we had that capability. I asked to give @xxchan the opportunity to squash the commits themselves and amend the commit message if they'd like to before merging |
Thanks, but I prefer simply clicking the button. 😄
…On Wed, 19 Jul 2023 at 19:18, Yacin Tmimi ***@***.***> wrote:
@calebcartwright <https://github.com/calebcartwright> appreciate you
pointing that out. I knew we had that capability. I asked to give @xxchan
<https://github.com/xxchan> the opportunity to squash the commits
themselves and amend the commit message if they'd like to before merging
—
Reply to this email directly, view it on GitHub
<#5838 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJBQZNPE5QZP2OAEECUHTRTXRAJH7ANCNFSM6AAAAAA2MX554Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
cargo-fmt
usesrustfmt
fromPATH
, socargo run --bin cargo-fmt
still uses installedrustfmt
instead of built one.