ci

CI for all possible combinations of features in Cargo.toml.
git clone https://git.philomathiclife.com/repos/ci
Log | Files | Refs | README

commit cf5518c3a3843b1bc4a166b4c600eed406a562f1
parent c107e6ad7f7abbd3a3fa3dd26f82a66ce417fa61
Author: Zack Newman <zack@philomathiclife.com>
Date:   Thu, 20 Feb 2025 15:38:47 -0700

rust 2024

Diffstat:
MCargo.toml | 10+++++-----
MREADME.md | 23++++++++++++++++++++---
Msrc/args.rs | 17++++++++++++-----
Msrc/main.rs | 6++++--
Msrc/manifest.rs | 4++--
5 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml @@ -3,18 +3,18 @@ authors = ["Zack Newman <zack@philomathiclife.com>"] categories = ["command-line-utilities", "development-tools::testing", "rust-patterns"] description = "Continuous integration for Clippy, unit tests, and doc tests for all possible features." documentation = "https://git.philomathiclife.com/ci/file/README.md.html" -edition = "2021" +edition = "2024" keywords = ["cargo", "ci", "rust"] license = "MIT OR Apache-2.0" name = "ci" readme = "README.md" repository = "https://git.philomathiclife.com/repos/ci/" -rust-version = "1.81.0" -version = "0.2.1" +rust-version = "1.85.0" +version = "0.2.2" [dependencies] -serde = { version = "1.0.215", default-features = false } -toml = { version = "0.8.19", default-features = false, features = ["parse"] } +serde = { version = "1.0.218", default-features = false } +toml = { version = "0.8.20", default-features = false, features = ["parse"] } [profile.release] lto = true diff --git a/README.md b/README.md @@ -33,14 +33,28 @@ When `clippy`, `doc_tests`, and `tests` are not passed; then all three are invok ## Limitations -Any use of `compile_error` _not_ related to incompatible features will be silently ignored. +Any use of `compile_error` _not_ related to incompatible features will be silently ignored. Any tests that +are marked `ignored` will not be run. + +## Minimum Supported Rust Version (MSRV) + +This will frequently be updated to be the same as stable. Specifically, any time stable is updated and that +update has "useful" features or compilation no longer succeeds (e.g., due to new compiler lints), then MSRV +will be updated. + +MSRV changes will correspond to a SemVer patch version bump pre-`1.0.0`; otherwise a minor version bump. + +## SemVer Policy + +* All on-by-default features of this library are covered by SemVer +* MSRV is considered exempt from SemVer as noted above ## License 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](https://www.apache.org/licenses/LICENSE-2.0)) +* MIT license ([LICENSE-MIT](https://opensource.org/licenses/MIT)) at your option. @@ -48,3 +62,6 @@ 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 conditions. + +Before any PR is sent, `cargo clippy` and `cargo t` should be run. Additionally +`RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features` should be run to ensure documentation can be built. diff --git a/src/args.rs b/src/args.rs @@ -10,7 +10,6 @@ use std::{ process::{Command, Stdio}, }; /// Error returned when parsing arguments passed to the application. -#[expect(clippy::module_name_repetitions, reason = "prefer this name")] #[derive(Clone, Debug)] pub enum ArgsErr { /// Error when no arguments exist. @@ -25,10 +24,18 @@ pub enum ArgsErr { impl Display for ArgsErr { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match *self { - Self::NoArgs => write!(f, "no arguments exist including the name of the process itself"), - Self::InvalidOption(ref arg) => write!(f, "{arg} is an invalid option. No arguments or exactly one of 'clippy', 'doc_tests', or 'tests' is allowed followed by nothing, '--color', or '--dir' and the path to the directory ci should run in"), + Self::NoArgs => write!( + f, + "no arguments exist including the name of the process itself" + ), + Self::InvalidOption(ref arg) => write!( + f, + "{arg} is an invalid option. No arguments or exactly one of 'clippy', 'doc_tests', or 'tests' is allowed followed by nothing, '--color', or '--dir' and the path to the directory ci should run in" + ), Self::DuplicateOption(ref arg) => write!(f, "{arg} was passed more than once"), - Self::MissingPath => f.write_str("--dir was passed without a path to the directory ci should run in"), + Self::MissingPath => { + f.write_str("--dir was passed without a path to the directory ci should run in") + } } } } @@ -74,7 +81,7 @@ impl Opts { } } /// Changes `self` such that it should contain color. - fn set_color(&mut self) { + const fn set_color(&mut self) { match *self { Self::None(ref mut color, _) | Self::Clippy(ref mut color) diff --git a/src/main.rs b/src/main.rs @@ -35,7 +35,8 @@ //! //! ## Limitations //! -//! Any use of [`compile_error`] _not_ related to incompatible features will be silently ignored. +//! Any use of [`compile_error`] _not_ related to incompatible features will be silently ignored. Any `ignored` +//! tests are not run. #![deny( unknown_lints, future_incompatible, @@ -63,6 +64,7 @@ )] #![expect( clippy::blanket_clippy_restriction_lints, + clippy::arbitrary_source_item_ordering, clippy::implicit_return, clippy::min_ident_chars, clippy::missing_trait_methods, @@ -87,7 +89,7 @@ use core::{ use std::{ collections::HashSet, env, fs, - io::{self, ErrorKind, Write}, + io::{self, ErrorKind, Write as _}, path::PathBuf, }; use toml::de::Error as TomlErr; diff --git a/src/manifest.rs b/src/manifest.rs @@ -158,7 +158,7 @@ impl<'de> Deserialize<'de> for Features { { /// `Visitor` for `Field`. struct FieldVisitor; - impl<'e> Visitor<'e> for FieldVisitor { + impl Visitor<'_> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { formatter.write_str("unique feature names") @@ -235,7 +235,7 @@ impl<'de> Deserialize<'de> for Manifest { { /// `Visitor` for `Field`. struct FieldVisitor; - impl<'f> Visitor<'f> for FieldVisitor { + impl Visitor<'_> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { write!(formatter, "'{FEATURES}'")