Skip to content

Clean up doc links and enforce them in CI #848

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

Merged
merged 6 commits into from
Mar 18, 2021

Conversation

TheBlueMatt
Copy link
Collaborator

Also adds some compile-time enforcement of doc links and missing doc fixes.

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #848 (e447131) into main (32f6205) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #848      +/-   ##
==========================================
- Coverage   90.66%   90.63%   -0.04%     
==========================================
  Files          51       51              
  Lines       27135    27135              
==========================================
- Hits        24603    24593      -10     
- Misses       2532     2542      +10     
Impacted Files Coverage Δ
background-processor/src/lib.rs 100.00% <ø> (ø)
lightning-block-sync/src/http.rs 95.39% <ø> (ø)
lightning-block-sync/src/init.rs 93.71% <ø> (ø)
lightning-block-sync/src/lib.rs 95.37% <ø> (ø)
lightning-block-sync/src/poll.rs 92.04% <ø> (ø)
lightning-block-sync/src/rest.rs 67.24% <ø> (ø)
lightning-block-sync/src/rpc.rs 79.48% <ø> (ø)
lightning-net-tokio/src/lib.rs 76.42% <ø> (ø)
lightning-persister/src/lib.rs 95.61% <ø> (ø)
lightning/src/chain/chainmonitor.rs 93.05% <ø> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32f6205...e447131. Read the comment docs.

Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

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

Nice! I didn't know this feature was stable.

@@ -1,3 +1,5 @@
//! Adapters which make one or more [`BlockSource`]s simpler to poll for new chain tip transitions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this work given the explanation for using the crate:: prefix in 1e71d32? Likewise in other files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As long as its imported in a use statement later in the file it seems to work (cargo doc doesn't error, which it now will if it doesnt resolve).

@@ -1187,8 +1181,6 @@ impl<Signer: Sign> ChannelMonitor<Signer> {

/// Get the list of HTLCs who's status has been updated on chain. This should be called by
/// ChannelManager via [`chain::Watch::release_pending_monitor_events`].
Copy link
Contributor

Choose a reason for hiding this comment

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

Are parentheses needed here or are they optional? I noticed that you add them elsewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe parentheses are only required when the link is ambiguous in some way. cargo doc fails with an ambiguity error in that case.

@TheBlueMatt TheBlueMatt force-pushed the 2021-03-doc-cleanups branch from 1a6becc to 0516b20 Compare March 17, 2021 21:33
@TheBlueMatt
Copy link
Collaborator Author

I didn't know this feature was stable.

Yea, I think its recent-ish. Certainly newer than a number of the html links in our codebase.

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

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

Compile-time enforcement == happiness

@TheBlueMatt TheBlueMatt force-pushed the 2021-03-doc-cleanups branch from 0516b20 to 3b81049 Compare March 17, 2021 22:07
Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

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

LGTM but prefer to drop ticks from the right-hand side as noted.

@TheBlueMatt TheBlueMatt force-pushed the 2021-03-doc-cleanups branch from 3b81049 to 529af8e Compare March 18, 2021 00:30
@TheBlueMatt
Copy link
Collaborator Author

Addressed comments, happy to squash if @valentinewallace is happy with the changes.

@jkczyz
Copy link
Contributor

jkczyz commented Mar 18, 2021

Not sure if it can be fixed, but FWIW older versions of Rust are giving the following warning:

warning: unknown lint: `broken_intra_doc_links`
  --> lightning/src/lib.rs:23:9
   |
23 | #![deny(broken_intra_doc_links)]
   |         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unknown_lints)] on by default

@TheBlueMatt
Copy link
Collaborator Author

Yea, I'm not aware of a (dependency-free) compile-time change to gate that on the rustc version. Not a huge deal, anyway.

@TheBlueMatt TheBlueMatt force-pushed the 2021-03-doc-cleanups branch from 529af8e to e447131 Compare March 18, 2021 15:28
@TheBlueMatt
Copy link
Collaborator Author

Squashed fixup commits with no changes:

$ git diff-tree -U5 529af8e8 e44713190a090156e4bffac518dad98574e411be
$ 

@TheBlueMatt TheBlueMatt merged commit fba204b into lightningdevkit:main Mar 18, 2021
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.

3 participants