diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 7ab13b9..27749d4 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -9,13 +9,13 @@ customManagers: [ { customType: 'regex', - fileMatch: [ - '^rust-toolchain\\.toml$', - 'Cargo.toml$', - 'clippy.toml$', - '\\.clippy.toml$', - '^\\.github/workflows/ci.yml$', - '^\\.github/workflows/rust-next.yml$', + managerFilePatterns: [ + '/^rust-toolchain\\.toml$/', + '/Cargo.toml$/', + '/clippy.toml$/', + '/\\.clippy.toml$/', + '/^\\.github/workflows/ci.yml$/', + '/^\\.github/workflows/rust-next.yml$/', ], matchStrings: [ 'STABLE.*?(?\\d+\\.\\d+(\\.\\d+)?)', diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00e4c6e..ea1c441 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Build run: cargo test --workspace --no-run - name: Test - run: cargo hack test --feature-powerset --workspace + run: cargo hack test --each-feature --workspace msrv: name: "Check MSRV" runs-on: ubuntu-latest @@ -64,7 +64,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@cargo-hack - name: Default features - run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets + run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going minimal-versions: name: Minimal versions runs-on: ubuntu-latest @@ -82,7 +82,7 @@ jobs: - name: Downgrade dependencies to minimal versions run: cargo +nightly generate-lockfile -Z minimal-versions - name: Compile with minimal versions - run: cargo +stable check --workspace --all-features --locked + run: cargo +stable check --workspace --all-features --locked --keep-going lockfile: runs-on: ubuntu-latest steps: @@ -109,7 +109,7 @@ jobs: - name: Check documentation env: RUSTDOCFLAGS: -D warnings - run: cargo doc --workspace --all-features --no-deps --document-private-items + run: cargo doc --workspace --all-features --no-deps --document-private-items --keep-going rustfmt: name: rustfmt runs-on: ubuntu-latest @@ -155,7 +155,7 @@ jobs: sarif_file: clippy-results.sarif wait-for-processing: true - name: Report status - run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated + run: cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings --allow deprecated coverage: name: Coverage runs-on: ubuntu-latest diff --git a/.github/workflows/rust-next.yml b/.github/workflows/rust-next.yml index e98386c..be8b2db 100644 --- a/.github/workflows/rust-next.yml +++ b/.github/workflows/rust-next.yml @@ -40,7 +40,7 @@ jobs: - name: Build run: cargo test --workspace --no-run - name: Test - run: cargo hack test --feature-powerset --workspace + run: cargo hack test --each-feature --workspace latest: name: "Check latest dependencies" runs-on: ubuntu-latest @@ -58,4 +58,4 @@ jobs: - name: Build run: cargo test --workspace --no-run - name: Test - run: cargo hack test --feature-powerset --workspace + run: cargo hack test --each-feature --workspace diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68db968..656c68e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,26 +1,19 @@ +default_install_hook_types: ["pre-commit", "commit-msg"] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-yaml - stages: [commit] - id: check-json - stages: [commit] - id: check-toml - stages: [commit] - id: check-merge-conflict - stages: [commit] - id: check-case-conflict - stages: [commit] - id: detect-private-key - stages: [commit] - repo: https://github.com/crate-ci/typos - rev: v1.16.20 + rev: v1.32.0 hooks: - id: typos - stages: [commit] - repo: https://github.com/crate-ci/committed - rev: v1.0.20 + rev: v1.1.7 hooks: - id: committed - stages: [commit-msg] diff --git a/Cargo.toml b/Cargo.toml index 9f84cf2..296a631 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,12 @@ include = [ "Cargo.lock", "LICENSE*", "README.md", - "benches/**/*", "examples/**/*" ] [workspace.lints.rust] rust_2018_idioms = { level = "warn", priority = -1 } +unnameable_types = "warn" unreachable_pub = "warn" unsafe_op_in_unsafe_fn = "warn" unused_lifetimes = "warn" @@ -62,7 +62,7 @@ lossy_float_literal = "warn" macro_use_imports = "warn" mem_forget = "warn" mutex_integer = "warn" -needless_continue = "warn" +needless_continue = "allow" needless_for_each = "warn" negative_feature_names = "warn" path_buf_push_overwrite = "warn" @@ -94,4 +94,4 @@ panic = "abort" panic = "abort" codegen-units = 1 lto = true -debug = "line-tables-only" +# debug = "line-tables-only" # requires Cargo 1.71 diff --git a/crates/lexarg-error/src/lib.rs b/crates/lexarg-error/src/lib.rs index aaeae46..691116a 100644 --- a/crates/lexarg-error/src/lib.rs +++ b/crates/lexarg-error/src/lib.rs @@ -15,10 +15,6 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - /// Collect context for creating an error #[derive(Debug)] pub struct ErrorContext<'a> { @@ -96,3 +92,7 @@ impl std::fmt::Display for ErrorContext<'_> { Ok(()) } } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/lexarg-parser/src/lib.rs b/crates/lexarg-parser/src/lib.rs index 0fb62e4..522816b 100644 --- a/crates/lexarg-parser/src/lib.rs +++ b/crates/lexarg-parser/src/lib.rs @@ -16,10 +16,6 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - mod ext; use std::ffi::OsStr; @@ -417,6 +413,7 @@ fn ceil_char_boundary(s: &str, curr_boundary: usize) -> Option { mod private { use super::OsStr; + #[allow(unnameable_types)] pub trait Sealed {} impl Sealed for [S; C] where S: AsRef + std::fmt::Debug {} impl Sealed for &'_ [S] where S: AsRef + std::fmt::Debug {} @@ -873,3 +870,7 @@ mod tests { } } } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/lexarg/src/lib.rs b/crates/lexarg/src/lib.rs index c8e8333..587e7bd 100644 --- a/crates/lexarg/src/lib.rs +++ b/crates/lexarg/src/lib.rs @@ -16,10 +16,6 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - /// Simplify parsing of arguments pub mod prelude { pub use crate::Arg::*; @@ -190,3 +186,7 @@ impl OptionContextExt for Option { }) } } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/libtest-lexarg/Cargo.toml b/crates/libtest-lexarg/Cargo.toml index 8b77027..d78d2ad 100644 --- a/crates/libtest-lexarg/Cargo.toml +++ b/crates/libtest-lexarg/Cargo.toml @@ -11,7 +11,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [package.metadata.release] pre-release-replacements = [ diff --git a/crates/libtest-lexarg/README.md b/crates/libtest-lexarg/README.md index b30c2d6..3aa8e22 100644 --- a/crates/libtest-lexarg/README.md +++ b/crates/libtest-lexarg/README.md @@ -10,8 +10,8 @@ Licensed under either of - * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. @@ -19,7 +19,7 @@ at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 -license, shall be dual licensed as above, without any additional terms or +license, shall be dual-licensed as above, without any additional terms or conditions. [Crates.io]: https://crates.io/crates/lexarg diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 50cac52..99e686c 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -550,3 +550,7 @@ fn is_nightly() -> bool { bootstrap || !disable_unstable_features } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/libtest2-harness/src/lib.rs b/crates/libtest2-harness/src/lib.rs index 3308621..dc6ffe8 100644 --- a/crates/libtest2-harness/src/lib.rs +++ b/crates/libtest2-harness/src/lib.rs @@ -25,10 +25,6 @@ // #![warn(clippy::print_stdout)] #![allow(clippy::todo)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - mod case; mod harness; mod notify; @@ -41,3 +37,7 @@ pub use case::*; pub use harness::*; pub use notify::RunMode; pub use state::*; + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/libtest2-mimic/src/lib.rs b/crates/libtest2-mimic/src/lib.rs index cf568bf..75ca2f5 100644 --- a/crates/libtest2-mimic/src/lib.rs +++ b/crates/libtest2-mimic/src/lib.rs @@ -24,10 +24,6 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - pub use libtest2_harness::Harness; pub use libtest2_harness::RunError; pub use libtest2_harness::RunResult; @@ -73,3 +69,7 @@ impl Case for Trial { (self.runner)(state) } } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/libtest2/src/lib.rs b/crates/libtest2/src/lib.rs index 5c4a6a4..2718c41 100644 --- a/crates/libtest2/src/lib.rs +++ b/crates/libtest2/src/lib.rs @@ -24,10 +24,6 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] -#[doc = include_str!("../README.md")] -#[cfg(doctest)] -pub struct ReadmeDoctests; - pub use libtest2_harness::Harness; pub use libtest2_harness::RunError; pub use libtest2_harness::RunResult; @@ -85,3 +81,7 @@ macro_rules! libtest2_main { } } } + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/deny.toml b/deny.toml index ee5ae89..2982ba3 100644 --- a/deny.toml +++ b/deny.toml @@ -94,6 +94,7 @@ allow = [ "CC0-1.0", "ISC", "OpenSSL", + "Zlib", ] # The confidence threshold for detecting a license from license text. # The higher the value, the more closely the license text must be to the