Skip to content

Self lint and cleanup#965

Open
tcharding wants to merge 4 commits into
rust-bitcoin:masterfrom
tcharding:push-kowuxrvtuxky
Open

Self lint and cleanup#965
tcharding wants to merge 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.

nyonson and others added 3 commits May 22, 2026 07:06
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.
@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.

Remove `use Foo::*` for bringing enum variants into scope.
@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.

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