Skip to content
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

docs: fix new clippy lint about excessively long initial line #730

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

apoelstra
Copy link
Member

Also does a few miscellaneous fixes that I noticed while fixing the lint.

Also does a few miscellaneous fixes that I noticed while fixing the
lint.
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

Ha, Poelstra patching docs like a junior dev! :)

I rekon we should fix the column width of the whole first paragraph not just move the line.

Comment on lines -19 to 28
/// No assumptions may be made about dissatisfying this fragment. This
/// No assumptions may be made about dissatisfying this fragment.
///
/// This
/// does not necessarily mean that there are multiple dissatisfactions;
/// there may be none, or none that are always available (e.g. for a
/// `pk_h` the key preimage may not be available).
Copy link
Member

Choose a reason for hiding this comment

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

This is an example that would be better with the column width fixing.

@apoelstra
Copy link
Member Author

We could go through all the docs and make them look nice, yes.

But this is causing local CI failures (and, I think, real CI failures) so I would like to just get it working.

@tcharding
Copy link
Member

Sure thing.

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 05dace0

@tcharding
Copy link
Member

ACK since this is not rust-bitcoin anyway, so I'm not as invested in it and the docs are not as polished.

Copy link
Contributor

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

Some comments.

@@ -351,7 +352,9 @@ fn interpreter_inp_check<C: secp256k1::Verification, T: Borrow<TxOut>>(
Ok(())
}

/// Finalize the psbt. This function takes in a mutable reference to psbt
/// Finalize the psbt.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe

Suggested change
/// Finalize the psbt.
/// Finalizes the psbt.

to adhere with other docstrings?

@@ -67,7 +69,9 @@ pub trait AssetProvider<Pk: MiniscriptKey> {
}

/// Given a keyhash, look up the EC signature and the associated key.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Given a keyhash, look up the EC signature and the associated key.
/// Given a keyhash, looks up the EC signature and the associated key.

//! A spending plan (or *plan*) is a representation of a particular spending path on a
//! descriptor.
//!
//! This allows us to analayze a choice of spending path without producing any
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! This allows us to analayze a choice of spending path without producing any
//! This allows us to analyze a choice of spending path without producing any

Copy link
Contributor

@storopoli storopoli Aug 28, 2024

Choose a reason for hiding this comment

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

Ok can I review-beg this typo at least 😢 @apoelstra?

@@ -76,7 +80,9 @@ pub trait AssetProvider<Pk: MiniscriptKey> {
}

/// Given a keyhash, look up the schnorr signature and the associated key.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Given a keyhash, look up the schnorr signature and the associated key.
/// Given a keyhash, looks up the Schnorr signature and the associated key.

/// Returns the key if a signature is found.
///
/// Even if signatures for public key Hashes are not available, the users
Copy link
Contributor

Choose a reason for hiding this comment

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

why capital H?

@@ -58,7 +59,8 @@ pub trait Satisfier<Pk: MiniscriptKey + ToPublicKey> {
/// Given a raw `Pkh`, lookup corresponding [`bitcoin::secp256k1::XOnlyPublicKey`]
Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot annotate above but in L40 there's a "look" -> "looks" and "schnorr" -> "Schnorr"

@tcharding
Copy link
Member

tcharding commented Aug 28, 2024

This is a CI fix PR @storopoli, also the minisicript rustdocs are nowhere near as polished as the rust-bitcoin docs so your suggestions, while valid, are probably to refined for this repo.

@apoelstra
Copy link
Member Author

Indeed. There are lots of poorly-formatted and ungrammatical docs in this repo. Many of them apply to error enums and other types which themselves are a huge mess. I'd rather not change stuff unless we're fixing the underlying type, because it would be a lot of (potentially-wasted) work and extra rebasing for me.

@tcharding
Copy link
Member

I never did get around to putting 3 months into miniscript - hopefully one day I will.

Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

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

ACK 05dace0

@apoelstra apoelstra merged commit 1f9fdb8 into rust-bitcoin:master Aug 30, 2024
30 checks passed
@apoelstra apoelstra deleted the 2024-08--docs branch August 30, 2024 14:40
@apoelstra
Copy link
Member Author

At some point I will open an issue to really fix the docs; but as mentioned, right now the majority of the documentation by volume seems to be on error variants, and I hope to significantly change those over the coming months and years.

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