Skip to content
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

Run doctests across the workspace on CI #1654

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ jobs:
brew install tree openssl gnu-sed
- name: "cargo check default features"
if: startsWith(matrix.os, 'windows')
run: cargo check --all --bins --examples
run: cargo check --workspace --bins --examples
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: "Test (nextest)"
env:
GIX_TEST_CREATE_ARCHIVES_EVEN_ON_CI: 1
run: cargo nextest run --all --no-fail-fast
run: cargo nextest run --workspace --no-fail-fast
- name: Doctest
run: cargo test --doc
run: cargo test --workspace --doc --no-fail-fast
- name: Check that tracked archives are up to date
run: git diff --exit-code # If this fails, the fix is usually to commit a regenerated archive.

Expand Down
11 changes: 6 additions & 5 deletions gix-merge/src/blob/builtin_driver/text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ pub enum ConflictStyle {
/// Only show the zealously minified conflicting lines of the local changes and the incoming (other) changes,
/// hiding the base version entirely.
///
/// ```
/// ```text
/// line1-changed-by-both
/// <<<<<<< local
/// line2-to-be-changed-in-incoming
/// =======
/// line2-changed
/// >>>>>>> incoming
///```
/// ```
#[default]
Merge,
/// Show non-minimized hunks of local changes, the base, and the incoming (other) changes.
///
/// This mode does not hide any information.
/// ```
///
/// ```text
/// <<<<<<< local
/// line1-changed-by-both
/// line2-to-be-changed-in-incoming
Expand All @@ -32,12 +33,12 @@ pub enum ConflictStyle {
/// line1-changed-by-both
/// line2-changed
/// >>>>>>> incoming
///```
/// ```
Diff3,
/// Like [`Diff3](Self::Diff3), but will show *minimized* hunks of local change and the incoming (other) changes,
/// as well as non-minimized hunks of the base.
///
/// ```
/// ```text
/// line1-changed-by-both
/// <<<<<<< local
/// line2-to-be-changed-in-incoming
Expand Down
2 changes: 1 addition & 1 deletion gix-merge/src/blob/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct Driver {
///
/// A typical invocation with all arguments substituted could then look like this:
///
/// ```
/// ```sh
/// <driver-program> .merge_file_nR2Qs1 .merge_file_WYXCJe .merge_file_UWbzrm 7 file e2a2970 HEAD feature
/// ```
///
Expand Down
7 changes: 5 additions & 2 deletions gix-pack/src/index/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! an index into the pack file
//!

/// From itertools
/// Create an iterator running multiple iterators in lockstep.
///
Expand All @@ -21,7 +21,7 @@
///
/// [`multizip`]: fn.multizip.html
///
/// ```
/// ```ignore
/// # use itertools::izip;
/// #
/// # fn main() {
Expand All @@ -37,6 +37,9 @@
/// assert_eq!(results, [0 + 3, 10 + 7, 29, 36]);
/// # }
/// ```
///
/// (The above is vendored from [itertools](https://github.com/rust-itertools/itertools),
/// including the original doctest, though it has been marked `ignore` here.)
macro_rules! izip {
// @closure creates a tuple-flattening closure for .map() call. usage:
// @closure partial_pattern => partial_tuple , rest , of , iterators
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clippy-fix:

# Build all code in suitable configurations
check:
cargo check --all
cargo check --workspace
cargo check --no-default-features --features small
# assure compile error occurs
if cargo check --features lean-async 2>/dev/null; then false; else true; fi
Expand Down Expand Up @@ -146,8 +146,8 @@ check:

# Run cargo doc on all crates
doc $RUSTDOCFLAGS="-D warnings":
cargo doc --all --no-deps --features need-more-recent-msrv
cargo doc --features=max,lean,small --all --no-deps --features need-more-recent-msrv
cargo doc --workspace --no-deps --features need-more-recent-msrv
cargo doc --features=max,lean,small --workspace --no-deps --features need-more-recent-msrv

# run all unit tests
unit-tests:
Expand Down
Loading