diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e768e42..2e12bb4 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -35,7 +35,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 52440ab..1dd2dd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,7 +158,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 8f8e8fe..79020a3 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 a5e88c7..c355091 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,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" @@ -104,7 +105,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/README.md b/README.md index 3978ee1..7d5dfe6 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,26 @@ ![License](https://img.shields.io/crates/l/toml-test.svg) [![Crates Status](https://img.shields.io/crates/v/toml-test.svg)](https://crates.io/crates/toml-test) -Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) - ## About [toml-test](https://github.com/BurntSushi/toml-test) is a language-agnostic toml parser spec verification. This crate aims to streamline using `toml-tests` on Rust crates. +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or ) + +at your option. + +### 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 +conditions. + [Documentation]: https://docs.rs/toml-test diff --git a/crates/data/Cargo.toml b/crates/data/Cargo.toml index 5c2b502..8fef0a0 100644 --- a/crates/data/Cargo.toml +++ b/crates/data/Cargo.toml @@ -23,7 +23,7 @@ include = [ [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [dependencies] include_dir = "0.7.0" diff --git a/crates/data/README.md b/crates/data/README.md index 047a888..d5c6eee 100644 --- a/crates/data/README.md +++ b/crates/data/README.md @@ -6,11 +6,26 @@ ![License](https://img.shields.io/crates/l/toml-test.svg) [![Crates Status](https://img.shields.io/crates/v/toml-test.svg)](https://crates.io/crates/toml-test) -Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) - ## About [toml-test](https://github.com/BurntSushi/toml-test) is a language-agnostic toml parser spec verification. This crate distributes all of the test cases. +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or ) + +at your option. + +### 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 +conditions. + + [Documentation]: https://docs.rs/toml-test diff --git a/crates/data/src/lib.rs b/crates/data/src/lib.rs index dedd910..1e29c7c 100644 --- a/crates/data/src/lib.rs +++ b/crates/data/src/lib.rs @@ -3,6 +3,10 @@ #![warn(clippy::print_stdout)] #![allow(clippy::self_named_module_files)] // `include_dir!`? +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + const TESTS_DIR: include_dir::Dir<'_> = include_dir::include_dir!("$CARGO_MANIFEST_DIR/assets/toml-test/tests"); diff --git a/crates/harness/Cargo.toml b/crates/harness/Cargo.toml index dba9f32..a9b6ac6 100644 --- a/crates/harness/Cargo.toml +++ b/crates/harness/Cargo.toml @@ -13,7 +13,7 @@ include.workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [dependencies] toml-test-data = { version = "1.12.1", path = "../data" } diff --git a/crates/harness/README.md b/crates/harness/README.md index ca6d0af..b703a79 100644 --- a/crates/harness/README.md +++ b/crates/harness/README.md @@ -6,11 +6,26 @@ ![License](https://img.shields.io/crates/l/toml-test.svg) [![Crates Status](https://img.shields.io/crates/v/toml-test.svg)](https://crates.io/crates/toml-test) -Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) - ## About [toml-test](https://github.com/BurntSushi/toml-test) is a language-agnostic toml parser spec verification. This crate exposes the test cases as Rust tests. +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or ) + +at your option. + +### 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 +conditions. + + [Documentation]: https://docs.rs/toml-test diff --git a/crates/harness/src/lib.rs b/crates/harness/src/lib.rs index 0b194b2..a49a421 100644 --- a/crates/harness/src/lib.rs +++ b/crates/harness/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; + use std::io::Write; pub use toml_test::decoded::Decoded; diff --git a/deny.toml b/deny.toml index b6ecbe9..ee5ae89 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", diff --git a/src/lib.rs b/src/lib.rs index df3f8eb..5d48e0c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,10 @@ #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; + mod error; pub mod decoded;