util/address: Improve docs#704
Conversation
The other sounds more natural to me as it describes what the function does. Can you explain why is this change useful? |
|
I agree to or don't care about the remaining changes. |
Drats! When I wrote the commit log and I couldn't come up with a reference for this change I knew it would come back to bite me :) I dug more into the topic, I could not find anyone mentioning it specifically in relation to Rust only to other languages so I looked at the following 'random' crates, all of them use 3rd person not imperative.
So it looks like I'm wrong in doing this change but I learned something in the process. I will remove these changes and make any other function docs that get edited use the 3rd person. Thanks for the review @Kixunil. |
5f47be4 to
ee457a2
Compare
|
I elected to force push with your suggestions implemented @Kixunil, the diff is not very long and in the name of making it easier for others to give their opinions I don't think I've made it much harder for you to re-review if you so desire. Thanks again! |
Improve documentation of the `address` module by doing: - Add full stops to all sentences - Use code ticks even inside links e.g., [`WitnessVersion`] - Use 100 character line length - Do grammar fixes - Use comment sections (e.g. `# Returns`) - Use 3rd person for function comments e.g. 'Converts foo to bar' instead of 'Convert foo to bar' - Use ticks for scriptPubkey This patch does a single file because a bunch of these changes pick an arbitrary stlye, if we can bikeshed on this PR then future PRs should be able to progress more quickly. I'll take lack of comment on any of the above as approval and I'll attempt to be uniform when doing the rest of the codebase. I plan on just chipping away at this, I can only do so much docs work in a day without getting bored of it :) Notes: - I didn't touch 'segwit' vs 'SegWit', seems both are widely used. - Using ticks inside links may be an overkill but seems more correct? - I'm not totally sure where the line is in the Rust ecosystem between readability in an editor and rendering as HTML, open to input on this.
ee457a2 to
eb8278f
Compare
Attempt to improve the rustdocs for `WitnessVersion` in line with review comments from a previous patch.
Improve the rustdocs for the various `Address` constructors by putting the brief description on a separate line with further description in its own paragraph. This is the layout best practice for function documentation using rustdocs. Also, favour 'creates' over 'constructs' because it is more common in the docs of this struct.
|
I've done both your remaining suggestions @Kixunil as separate patches. Thanks. |
|
belated concept ack |
c73eb2f Use 'extra' instead of 'cheap' (Tobin Harding) c79eb97 Remove unnecessary explanation (Tobin Harding) f95e91a Use isn't instead of shouldn't (Tobin Harding) c9e6ca1 Use rust-bitcoin module doc style (Tobin Harding) 3fa6762 Add link to referenced commit (Tobin Harding) f5e68f3 Add ticks around code snippet (Tobin Harding) d25431c Use 3rd person tense for function docs (Tobin Harding) c3be285 Fix size constant docs (Tobin Harding) 5e07e75 Add period to sentences (Tobin Harding) 269bde0 Remove unnecessary capitalisation (Tobin Harding) Pull request description: In a continued effort to find my feet around here, and inspired by issue #128 I've done a codebase wide audit of the docs (primarily just rustdocs but I glanced at `//` docs as well). Each change is in a separate commit so can be removed if resistance is met. (_"resistance is futile"_). I've based the stylistic decisions on [work done](rust-bitcoin/rust-bitcoin#704) in rust-bitcoin. I believe the only controversial change is the last (commit: da161c9 Use rust-bitcoin module doc style), please review that one carefully. ACKs for top commit: apoelstra: ACK c73eb2f Tree-SHA512: 5ea215de3fd23ca2a4f25d8f8d59a85a299044fe495269c43b621291ea50c58856fa8544e36cc109b7bdb1a7a59bcab8711f30113572ddce4509d3b06ff0d3b6
c73eb2f391d797256fb09545584c998d723d6f72 Use 'extra' instead of 'cheap' (Tobin Harding) c79eb976ca4c5cd02275b4f3c843380f64f563b7 Remove unnecessary explanation (Tobin Harding) f95e91a6dac2b585e868910119e22599b242911e Use isn't instead of shouldn't (Tobin Harding) c9e6ca168000aa3b0aea128048a7f7a40986398c Use rust-bitcoin module doc style (Tobin Harding) 3fa67624375ba529ad37f7786ca759224ff139fd Add link to referenced commit (Tobin Harding) f5e68f3ba76d734d9ef2a4ef9cad89879622958a Add ticks around code snippet (Tobin Harding) d25431c1da9e290518e9e6aaace8c882fd047edb Use 3rd person tense for function docs (Tobin Harding) c3be285c1dbad037609f9f11a61c4aa12d6f370e Fix size constant docs (Tobin Harding) 5e07e7596b3c128c2290089f87a2851946fb538d Add period to sentences (Tobin Harding) 269bde042f9d6bfccb857c6921e71f01a9854f35 Remove unnecessary capitalisation (Tobin Harding) Pull request description: In a continued effort to find my feet around here, and inspired by issue #128 I've done a codebase wide audit of the docs (primarily just rustdocs but I glanced at `//` docs as well). Each change is in a separate commit so can be removed if resistance is met. (_"resistance is futile"_). I've based the stylistic decisions on [work done](rust-bitcoin/rust-bitcoin#704) in rust-bitcoin. I believe the only controversial change is the last (commit: da161c9 Use rust-bitcoin module doc style), please review that one carefully. ACKs for top commit: apoelstra: ACK c73eb2f391d797256fb09545584c998d723d6f72 Tree-SHA512: 5ea215de3fd23ca2a4f25d8f8d59a85a299044fe495269c43b621291ea50c58856fa8544e36cc109b7bdb1a7a59bcab8711f30113572ddce4509d3b06ff0d3b6
c73eb2f391d797256fb09545584c998d723d6f72 Use 'extra' instead of 'cheap' (Tobin Harding) c79eb976ca4c5cd02275b4f3c843380f64f563b7 Remove unnecessary explanation (Tobin Harding) f95e91a6dac2b585e868910119e22599b242911e Use isn't instead of shouldn't (Tobin Harding) c9e6ca168000aa3b0aea128048a7f7a40986398c Use rust-bitcoin module doc style (Tobin Harding) 3fa67624375ba529ad37f7786ca759224ff139fd Add link to referenced commit (Tobin Harding) f5e68f3ba76d734d9ef2a4ef9cad89879622958a Add ticks around code snippet (Tobin Harding) d25431c1da9e290518e9e6aaace8c882fd047edb Use 3rd person tense for function docs (Tobin Harding) c3be285c1dbad037609f9f11a61c4aa12d6f370e Fix size constant docs (Tobin Harding) 5e07e7596b3c128c2290089f87a2851946fb538d Add period to sentences (Tobin Harding) 269bde042f9d6bfccb857c6921e71f01a9854f35 Remove unnecessary capitalisation (Tobin Harding) Pull request description: In a continued effort to find my feet around here, and inspired by issue #128 I've done a codebase wide audit of the docs (primarily just rustdocs but I glanced at `//` docs as well). Each change is in a separate commit so can be removed if resistance is met. (_"resistance is futile"_). I've based the stylistic decisions on [work done](rust-bitcoin/rust-bitcoin#704) in rust-bitcoin. I believe the only controversial change is the last (commit: da161c9 Use rust-bitcoin module doc style), please review that one carefully. ACKs for top commit: apoelstra: ACK c73eb2f391d797256fb09545584c998d723d6f72 Tree-SHA512: 5ea215de3fd23ca2a4f25d8f8d59a85a299044fe495269c43b621291ea50c58856fa8544e36cc109b7bdb1a7a59bcab8711f30113572ddce4509d3b06ff0d3b6
Improve documentation of the
addressmodule by doing:WitnessVersion]# Returns)This patch does a single file because a bunch of these changes pick an
arbitrary stlye, if we can bikeshed on this PR then future PRs should be
able to progress more quickly. I'll take lack of comment on any of the
above as approval and I'll attempt to be uniform when doing the rest of
the codebase. I plan on just chipping away at this, I can only do so
much docs work in a day without getting bored of it :)
Notes:
readability in an editor and rendering as HTML, open to input on this.