-
Notifications
You must be signed in to change notification settings - Fork 281
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
Introduce rustfmt
#499
Introduce rustfmt
#499
Conversation
b28092b
to
135a304
Compare
WTF, the format change fail in CI is to a line that I cannot find in locally. |
(A bit off-topic) @tcharding What do you think about: rust-lang/rustfmt#5584 ? |
I like the idea, not sure why the lad is so unequivocally against it. I don't think it helps us though since "existing" is unformatted the "desired" would never be triggered. |
That's a good point. It only helps projects that are already formatted. |
135a304
to
5986121
Compare
As we did in `rust-bitcoin` introduced a `rustfmt` configuration file that is palatable to devs. Do not run formatter, that is done as a separate patch to assist review.
In preparation for running the formatter do minor refactorings and add a bunch of `rustfmt::skip` directives.
Run the command `cargo +nightly fmt` to fix formatting issues. The formatter got confused in one place, adding an incorrect indentation, this was manually fixed.
5986121
to
e0e575d
Compare
Please note the recently added deprecated "since" strings are so long that they now go over multiple lines, its ugly but I figured since we remove them in a release anyway I'd leave them as is. Can change if required. |
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.
ACK e0e575d
Will hold off on merging this for a bit since there are other PRs in flight and I think this'll conflict with everything. |
For me its better to just merge this one first please, I find these rustfmt PRs super boring to do where as I'm ok to rebase the others because they are much more interesting work. The only active PRs are my two I think. |
Hah, fair enough. Merging now. |
75f3886 Add cargo fmt to pre-commit githook (Tobin C. Harding) 0516dde Add formatting check to CI (Tobin C. Harding) c7807df Run the formatter (Tobin C. Harding) Pull request description: We recently introduced `rustfmt` to the codebase but I forgot to turn it on in CI. - Patch 1: Preparatory formatting fixes, introduced since we merged the [formatting PR](#499) - Patch 2: Enable formatting in CI - Patch 3: Add formatting to the pre-commit hook ACKs for top commit: apoelstra: ACK 75f3886 Tree-SHA512: 5ac4ab4015a9728ef890e0c4fe90afcb5e45ab7665da5a8ee289dc877c1ea5c6236e54b68b7122841597864b04606c8bfae7dec86c4b6be74d32437299057b5f
(Includes the patch from #504, I pulled it out of this to merge faster)
Introduce
rustfmt
by doing:rustfmt
config file fromrust-bitcoin
#[rustfmt::skip]
as needed and doing some manual format improvements.cargo +nightly fmt
Thanks in advance for doing the painful review on patch 3.