cargo-ghdoc

Crates.iocargo-ghdoc
lib.rscargo-ghdoc
version0.4.0
sourcesrc
created_at2022-02-15 21:14:27.822964
updated_at2022-03-08 22:05:09.016027
descriptionView Rust docs for open PRs
homepage
repositoryhttps://github.com/fulcrumgenomics/cargo-ghdoc
max_upload_size
id532927
size17,277
Tim Fennell (tfenne)

documentation

https://docs.rs/cargo-ghdoc

README

cargo-ghdoc

license Version info

Launch cargo docs from a github PR.

This tool is intended as an aid when reviewing PRs in Rust projects. It's often hard to tell what the docs will look like before rendering. It's also often hard to gain context for a PR without seeing the docs. This tool solves both of those problems with a single command.

Install

cargo install cargo-ghdoc

Usage

From an open PR page in github, copy the URL at the top of the page. Then run the following, replacing the URL here with your open PR.

cargo ghdoc https://github.com/fulcrumgenomics/cargo-ghdoc/pull/1

This will open the Rust docs for the Rust project from a checkout of that PR.

Proceed to nit pick.

Implementation notes

This tool is just running git and cargo shell commands under the hood. As such both binaries should be findable in your path. Additionally this tool requires that you have set up SSH credentials and that they are valid for the repo in question.

Equivalent shell commands:

mkdir <tempdir>
cd <tempdir>
git clone <repo>
cd <repo>
git fetch origin pull/<PR number>/head:GHDOC
git checkout GHDOC
cargo doc --open

Since this tool is piggybacking off of git, you must have sufficient permissions to run those command.

Commit count: 20

cargo fmt