From 9ecc0e1646866791214621b5d7b6a1c15b0415d6 Mon Sep 17 00:00:00 2001 From: Sukuna0007Abhi Date: Sun, 5 Oct 2025 19:07:41 +0000 Subject: [PATCH] feat: add documentation checks to CI pipeline - Add 'cargo doc' with RUSTDOCFLAGS="-D warnings" to CI workflow - Ensures documentation builds successfully and catches doc warnings - Include --document-private-items flag for comprehensive doc coverage - Fix dead code warnings in base64.rs using #[allow(dead_code)] - Resolves issue #23: documentation should be checked by the CI The CI now validates: 1. Code formatting (cargo fmt) 2. Clippy lints 3. Documentation generation (NEW) 4. Build process 5. Test execution Signed-off-by: Sukuna0007Abhi --- .github/workflows/ci.yml | 2 ++ src/token/base64.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17ea25c..9c90b0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: run: cargo fmt --all -- --check - name: Clippy checks run: cargo clippy --all-targets -- -D clippy::all -D clippy::cargo -A clippy::multiple-crate-versions + - name: Documentation checks + run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items - name: Build run: cargo build --verbose - name: Run tests diff --git a/src/token/base64.rs b/src/token/base64.rs index 360bfe0..d34f049 100644 --- a/src/token/base64.rs +++ b/src/token/base64.rs @@ -16,9 +16,11 @@ pub fn decode_str(v: &str) -> Result, Error> { } /// a `Vec` encoded as base64 in human readable serialization +#[allow(dead_code)] #[derive(Debug, PartialEq)] pub struct Bytes(Vec); +#[allow(dead_code)] impl Bytes { pub fn new() -> Self { Bytes(Vec::new()) @@ -73,6 +75,7 @@ impl<'de> Deserialize<'de> for Bytes { } } +#[allow(dead_code)] struct BytesVisitor; impl Visitor<'_> for BytesVisitor {