Skip to content

Self lint and cleanup#965

Merged
apoelstra merged 4 commits into
rust-bitcoin:masterfrom
tcharding:push-kowuxrvtuxky
Jun 3, 2026
Merged

Self lint and cleanup#965
apoelstra merged 4 commits into
rust-bitcoin:masterfrom
tcharding:push-kowuxrvtuxky

Conversation

@tcharding
Copy link
Copy Markdown
Member

This is Nick's patch from #963 + the Self stuff from #944 + a patch on top to remove some of the use Policy::* instances. There are some in there still because I can't be bothered right now working out why Self:: doesn't work everywhere. This is a step in the right direction.

@tcharding
Copy link
Copy Markdown
Member Author

Formatting in separate patches to ease review.

@tcharding
Copy link
Copy Markdown
Member Author

I went ahead and poached your patch @nyonson.

@trevarj
Copy link
Copy Markdown
Contributor

trevarj commented May 25, 2026

Run the forgatter

g and m aren't even close on any keyboard layout!

Will you squash the formatting commits into their parents?

ACK 7af8cb9

@apoelstra
Copy link
Copy Markdown
Member

Will you squash the formatting commits into their parents?

For the use_self one I think it'd make the combo-commit much harder to read.

For the "no wildcards" commit sure, there's not a ton of benefit in separating that from the formatter.

@tcharding
Copy link
Copy Markdown
Member Author

Everyone knows hard core hackers call it a forgatter, keep up.

@tcharding tcharding force-pushed the push-kowuxrvtuxky branch from 7af8cb9 to 8ef4be4 Compare May 26, 2026 00:31
@tcharding
Copy link
Copy Markdown
Member Author

Squashed ... which also removed the slang typo.

@apoelstra
Copy link
Copy Markdown
Member

@tcharding Could you re-order these commits?

Because the first commit (which enables lints but doesn't make them pass) is the tip of #963, my CI system is trying to test it in "tip" mode, which runs clippy, which fails.

Rather than re-architecting my system to understand "test this commit as though it was part of #965 and not part of #963", I think it's easier to make this your problem.

@tcharding
Copy link
Copy Markdown
Member Author

I think it's easier to make this your problem.

Lol, love it. Can do.

@tcharding tcharding force-pushed the push-kowuxrvtuxky branch 2 times, most recently from c40f957 to 3ee46ba Compare June 2, 2026 00:48
tcharding and others added 4 commits June 2, 2026 10:52
Tighten up the linting by using `use_self` and fix all warnings.

I got claude to do the fixes. It eventually found its way to using

cargo clippy --fix --allow-dirty --allow-staged --workspace \
--all-targets --all-features -- -D clippy::use-self 

FTR this does not enable the lint because for some reason adding this
to the manifest doesn't work.

```rust
[workspace.lints.clippy]
use_self = "warn"
```

I tested this patch using

  `cargo +$(cat ./nightly-version ) clippy -- -D clippy::use-self`
All these issues were introduced by the `use_self` change. Fixed
separately to make review of that change easier since its 12000 lines
long.
Remove `use Foo::*` for bringing enum variants into scope.
@tcharding tcharding force-pushed the push-kowuxrvtuxky branch from 3ee46ba to 2cc105c Compare June 2, 2026 00:52
Copy link
Copy Markdown
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 2cc105c; successfully ran local tests

@tcharding
Copy link
Copy Markdown
Member Author

I thought of this joke the other day but couldn't find a 'master' quote then coincidentally re-read Eric Raymond's seminal (to me anyways) paper on how to be a hacker and it has the quote in it I wanted. So here it is, for your amusement.

Poelstra says, "I think it's easier to make this your problem."

I drift back to the days of being an apprentice and remember:

Look to the master,
Follow the master,
Walk with the master,
See through the master,
Become the master.

Then think, "mad, I'm saying that from now on - I think it's easier to make this your problem."

@apoelstra apoelstra merged commit bdf50e3 into rust-bitcoin:master Jun 3, 2026
27 checks passed
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

Successfully merging this pull request may close these issues.

4 participants