Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,17 @@ jobs:
name: "run clippy"
run: |
just debug_justfile="${{matrix.debug_justfile}}" profile=${{matrix.profile.name}} \
${{matrix.profile.sterile}} cargo clippy --all-targets --all-features -- -D warnings
${{matrix.profile.sterile}} cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings

- id: "docs"
name: "run rustdoc"
if: ${{matrix.profile.name == 'release'}}
Copy link
Member

Choose a reason for hiding this comment

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

❤️

run: |
RUSTDOCFLAGS="-D warnings" just \
RUSTDOCFLAGS="-D warnings --document-private-items --allow rustdoc::all" just \
debug_justfile="${{matrix.debug_justfile}}" \
profile=${{matrix.profile.name}} \
target=x86_64-unknown-linux-gnu \
${{matrix.profile.sterile}} cargo doc
${{matrix.profile.sterile}} cargo doc --workspace --no-deps

- name: "Setup tmate session for debug"
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
Expand Down
1 change: 1 addition & 0 deletions dpdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#![warn(clippy::all)]
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#![deny(rustdoc::all)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(private_bounds)]
extern crate alloc;
extern crate core;
Expand Down
20 changes: 18 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,25 @@ cargo *args:
declare -rx RUSTFLAGS="${RUSTFLAGS_DEBUG}"
fi

export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} ${RUSTFLAGS} --html-in-header $(pwd)/scripts/doc/custom-header.html"
export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} ${RUSTFLAGS} --html-in-header $(pwd)/scripts/doc/custom-header.html --document-private-items"
./compile-env/bin/cargo "${extra_args[@]}"


# Here we may list external crates for which we want docs because
# the workspace crates' documentations refer to them.
external := "left-right etherparse dataplane-dpdk-sys"

# Generate docs for the crates in this project
[script]
docs:
export RUSTDOCFLAGS="--html-in-header $(pwd)/scripts/doc/custom-header.html --document-private-items --allow rustdoc::all"
for crate in {{ external }}; do
echo "Documenting $crate..."
./compile-env/bin/cargo doc -p $crate --no-deps
done
./compile-env/bin/cargo doc --workspace --no-deps


# Run the (very minimal) compile environment
[script]
compile-env *args:
Expand Down Expand Up @@ -514,7 +530,7 @@ print-container-tags:

# Run Clippy like you're in CI
[script]
clippy *args: (cargo "clippy" "--all-targets" "--all-features" args "--" "-D" "warnings")
clippy *args: (cargo "clippy" "--workspace" "--no-deps" "--all-targets" "--all-features" args "--" "-D" "warnings")

# Serve rustdoc output locally (using port 8000)
[script]
Expand Down
1 change: 1 addition & 0 deletions nat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(clippy::all, clippy::pedantic)]
#![deny(rustdoc::all)]
#![allow(rustdoc::broken_intra_doc_links)]
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not ignore these reports, could we fix the docs in nat instead?

I took a quick look and the only one I got to fix was:

diff --git i/nat/src/stateful/apalloc/setup.rs w/nat/src/stateful/apalloc/setup.rs
index 71508eb41328..f83f525c44ad 100644
--- i/nat/src/stateful/apalloc/setup.rs
+++ w/nat/src/stateful/apalloc/setup.rs
@@ -19,8 +19,9 @@ use std::time::Duration;
 use tracing::debug;
 
 impl NatDefaultAllocator {
-    /// Build a [`NatDefaultAllocator`] from information collected from a [`VpcTable`] object. This
-    /// information is passed as a [`StatefulNatConfig`].
+    /// Build a [`NatDefaultAllocator`] from information collected from a
+    /// [`VpcTable`][config::external::overlay::vpc::VpcTable] object.
+    /// This information is passed as a [`StatefulNatConfig`].
     ///
     /// # Returns
     ///

Let me know if you got more, if I can reproduce I'm happy to address them in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there were very few. Happy if we fix the docs in each crate, more than brutally disabling the lints as I did.

#![allow(clippy::missing_errors_doc)]

//! Network Address Translation (NAT) for the dataplane
Expand Down
2 changes: 1 addition & 1 deletion tracectl/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl TracingControl {
Ok(db.default)
}

/// Parse a string made of comma-separated tag=level; level = [off,error,warn,info,debug,trace]
/// Parse a string made of comma-separated tag=level; level = \[`off,error,warn,info,debug,trace`\]
fn parse_tracing_config(input: &str) -> Result<OrderMap<String, LevelFilter>, TraceCtlError> {
let mut result = OrderMap::new();

Expand Down
Loading