From 16c8801871a0f260c9cd9d07140e20ee578ff927 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Tue, 27 Aug 2024 15:22:05 -0400 Subject: [PATCH 1/2] ci: add doc job --- .github/workflows/pipeline.yml | 11 +++++++++++ Makefile | 5 ++++- src/extract/error.rs | 2 +- src/walk/website/walk_builder.rs | 6 +++--- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index e6a16b2..2c43ba2 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -53,6 +53,17 @@ jobs: tools: cargo-nextest - run: cargo check --all-features --all-targets + doc: + name: Doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Boshen/setup-rust@main + with: + cache-key: warm + components: rustdoc + - run: make doc + test: name: Test runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index afdc076..14a3b36 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: init check build run debug fmt lint fix test test-cov bench clean purge +.PHONY: init bench build check clean debug doc fix fmt lint purge run test test-cov build: cargo build --release --all-features @@ -12,6 +12,9 @@ check: debug: tmp/yc-companies.csv RUST_LOG=keyhunter=debug RUST_BACKTRACE=1 cargo run --features report --example yc_startups +doc: + RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features --document-private-items + fmt: taplo format cargo fmt diff --git a/src/extract/error.rs b/src/extract/error.rs index a7c66e8..0fcdef6 100644 --- a/src/extract/error.rs +++ b/src/extract/error.rs @@ -172,7 +172,7 @@ pub enum DownloadScriptDiagnostic { #[diagnostic(code(keyhunter::extract::download::read_failed))] CannotReadBody(/* url */ String, #[source] std::io::Error), - /// Downloaded the resource at a [`Url`] but it was not a JavaScript file + /// Downloaded the resource at a URL but it was not a JavaScript file #[error("Resource at {0} is not a JavaScript file, but is instead {1}")] #[diagnostic(code(keyhunter::extract::download::not_js))] NotJavascript(/* url */ String, /* content type */ String), diff --git a/src/walk/website/walk_builder.rs b/src/walk/website/walk_builder.rs index 50741f2..ae35d5c 100644 --- a/src/walk/website/walk_builder.rs +++ b/src/walk/website/walk_builder.rs @@ -139,7 +139,7 @@ impl WebsiteWalkBuilder { /// accessing websites, and so using a random UA may not be ideal. /// /// This is a semi-specific case of - /// [`WebsiteWalkBuilder::with_extra_header`]. `User-Agent`s set with this + /// [`WebsiteWalkBuilder::with_header`]. `User-Agent`s set with this /// method will take precedence. /// /// By default, no `User-Agent` header is set. @@ -156,7 +156,7 @@ impl WebsiteWalkBuilder { /// Add an extra header to all requests. /// - /// Use [`WebsiteWalkBuilder::with_extra_headers`] for adding multiple headers. + /// Use [`WebsiteWalkBuilder::with_headers`] for adding multiple headers. #[inline] pub fn with_header>(mut self, key: S, value: S) -> Self { let key = key.into(); @@ -171,7 +171,7 @@ impl WebsiteWalkBuilder { /// Add extra headers to all requests /// - /// Use [`WebsiteWalkBuilder::with_extra_header`] for adding a single header. + /// Use [`WebsiteWalkBuilder::with_header`] for adding a single header. pub fn with_headers(mut self, headers: I) -> Self where I: IntoIterator, From cad2b90585f3ccc3d0a6f23c557419b87d3422c2 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Tue, 27 Aug 2024 15:23:59 -0400 Subject: [PATCH 2/2] ci: fix rust-docs component name --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 2c43ba2..1070f4a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -61,7 +61,7 @@ jobs: - uses: Boshen/setup-rust@main with: cache-key: warm - components: rustdoc + components: rust-docs - run: make doc test: