diff --git a/.github/renovate.json5 b/.github/renovate.json5 index c1844208..7ab13b9f 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -32,7 +32,7 @@ matchManagers: [ 'custom.regex', ], - matchPackageNames: [ + matchDepNames: [ 'STABLE', ], extractVersion: '^(?\\d+\\.\\d+)', // Drop the patch version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0759c58a..bcf70af0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,7 +151,7 @@ jobs: run: cargo install sarif-fmt --locked - name: Check run: > - cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated + cargo clippy --workspace --all-features --all-targets --message-format=json | clippy-sarif | tee clippy-results.sarif | sarif-fmt diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ac2c875..3577316b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,18 +7,18 @@ appreciate any level you're willing to do. Need some new functionality to help? You can let us know by opening an [issue][new issue]. It's helpful to look through [all issues][all issues] in -case its already being talked about. +case it's already being talked about. ## Bug Reports Please let us know about what problems you run into, whether in behavior or ergonomics of API. You can do this by opening an [issue][new issue]. It's -helpful to look through [all issues][all issues] in case its already being +helpful to look through [all issues][all issues] in case it's already being talked about. ## Pull Requests -Looking for an idea? Check our [issues][issues]. If it's look more open ended, +Looking for an idea? Check our [issues][issues]. If the issue looks open ended, it is probably best to post on the issue how you are thinking of resolving the issue so you can get feedback early in the process. We want you to be successful and it can be discouraging to find out a lot of re-work is needed. @@ -41,15 +41,18 @@ As a heads up, we'll be running your PR through the following gauntlet: Not everything can be checked automatically though. We request that the commit history gets cleaned up. + We ask that commits are atomic, meaning they are complete and have a single responsibility. -PRs should tell a cohesive story, with test and refactor commits that keep the +A complete commit should build, pass tests, update documentation and tests, and not have dead code. + +PRs should tell a cohesive story, with refactor and test commits that keep the fix or feature commits simple and clear. Specifically, we would encourage - File renames be isolated into their own commit -- Add tests in a commit before their feature or fix, showing the current behavior. +- Add tests in a commit before their feature or fix, showing the current behavior (i.e. they should pass). The diff for the feature/fix commit will then show how the behavior changed, - making it clearer to reviewrs and the community and showing people that the + making the commit's intent clearer to reviewers and the community, and showing people that the test is verifying the expected state. - e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520) diff --git a/Cargo.toml b/Cargo.toml index a78c7a45..6bb175a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,6 +70,7 @@ rc_mutex = "warn" redundant_feature_names = "warn" ref_option_ref = "warn" rest_pat_in_fully_bound_structs = "warn" +result_large_err = "allow" same_functions_in_if_condition = "warn" self_named_module_files = "warn" semicolon_if_nothing_returned = "warn" diff --git a/crates/snapbox-macros/Cargo.toml b/crates/snapbox-macros/Cargo.toml index 87941654..ebd6e63a 100644 --- a/crates/snapbox-macros/Cargo.toml +++ b/crates/snapbox-macros/Cargo.toml @@ -15,6 +15,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [features] default = [] diff --git a/crates/snapbox-macros/README.md b/crates/snapbox-macros/README.md index d25fd8e9..f8481bd3 100644 --- a/crates/snapbox-macros/README.md +++ b/crates/snapbox-macros/README.md @@ -10,16 +10,16 @@ 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. -## Contribution +### Contribution 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/snapbox diff --git a/crates/snapbox-macros/src/lib.rs b/crates/snapbox-macros/src/lib.rs index 2eddb8fd..6b4f1e1a 100644 --- a/crates/snapbox-macros/src/lib.rs +++ b/crates/snapbox-macros/src/lib.rs @@ -2,6 +2,10 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + #[cfg(feature = "color")] pub use anstream::eprint; #[cfg(feature = "color")] diff --git a/crates/snapbox/Cargo.toml b/crates/snapbox/Cargo.toml index cfbb8388..de1c33b2 100644 --- a/crates/snapbox/Cargo.toml +++ b/crates/snapbox/Cargo.toml @@ -15,8 +15,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [package.metadata.release] pre-release-replacements = [ diff --git a/crates/snapbox/README.md b/crates/snapbox/README.md index 3e6c9b68..bbfdd111 100644 --- a/crates/snapbox/README.md +++ b/crates/snapbox/README.md @@ -19,16 +19,16 @@ See the [docs](http://docs.rs/snapbox) for more. 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. -## Contribution +### Contribution 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/snapbox diff --git a/crates/snapbox/src/lib.rs b/crates/snapbox/src/lib.rs index b791c5f1..1dea4a93 100644 --- a/crates/snapbox/src/lib.rs +++ b/crates/snapbox/src/lib.rs @@ -64,6 +64,10 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + mod macros; pub mod assert; diff --git a/crates/trycmd/Cargo.toml b/crates/trycmd/Cargo.toml index 4763973b..01c5022c 100644 --- a/crates/trycmd/Cargo.toml +++ b/crates/trycmd/Cargo.toml @@ -16,8 +16,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [package.metadata.release] pre-release-replacements = [ diff --git a/crates/trycmd/README.md b/crates/trycmd/README.md index 7e8e7037..4cacebce 100644 --- a/crates/trycmd/README.md +++ b/crates/trycmd/README.md @@ -48,7 +48,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/trycmd diff --git a/crates/trycmd/src/lib.rs b/crates/trycmd/src/lib.rs index 54d2aa32..63816429 100644 --- a/crates/trycmd/src/lib.rs +++ b/crates/trycmd/src/lib.rs @@ -229,6 +229,10 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + pub mod cargo; pub mod schema; diff --git a/crates/tryfn/Cargo.toml b/crates/tryfn/Cargo.toml index 4fc7d87f..3d267367 100644 --- a/crates/tryfn/Cargo.toml +++ b/crates/tryfn/Cargo.toml @@ -16,8 +16,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [package.metadata.release] pre-release-replacements = [ diff --git a/crates/tryfn/README.md b/crates/tryfn/README.md index 9a6c44a9..863c9c8b 100644 --- a/crates/tryfn/README.md +++ b/crates/tryfn/README.md @@ -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/tryfn diff --git a/crates/tryfn/src/lib.rs b/crates/tryfn/src/lib.rs index 9f76016c..45d2f16a 100644 --- a/crates/tryfn/src/lib.rs +++ b/crates/tryfn/src/lib.rs @@ -39,6 +39,14 @@ //! } //! ``` +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + use libtest_mimic::Trial; pub use snapbox::data::DataFormat; diff --git a/deny.toml b/deny.toml index b6ecbe9c..ee5ae89b 100644 --- a/deny.toml +++ b/deny.toml @@ -87,6 +87,7 @@ allow = [ "MIT", "MIT-0", "Apache-2.0", + "BSD-2-Clause", "BSD-3-Clause", "MPL-2.0", "Unicode-DFS-2016",