diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e60d260d..bd69cfc61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ From 2019 onwards, all notable changes to tarpaulin will be documented in this file. +## [0.27.1] 2023-10-02 +### Changed +- Restore casing of enum clap arguments e.g. `--out` so they match old behaviour + ## [0.27.0] 2023-09-17 ### Added - Added `--fail-immediately` flag to abort execution the moment the first test failure occurs diff --git a/Cargo.lock b/Cargo.lock index c83ae2de1..058f24d01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ [[package]] name = "cargo-tarpaulin" -version = "0.27.0" +version = "0.27.1" dependencies = [ "cargo_metadata", "cfg-if", @@ -220,9 +220,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -459,9 +459,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ef350ba88a33b4d524b1d1c79096c9ade5ef8c59395df0e60d1e1889414c0e" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ "bitflags 2.4.0", "libc", @@ -935,13 +935,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", + "regex-automata 0.3.9", "regex-syntax 0.7.5", ] @@ -956,9 +956,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -1257,9 +1257,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c226a7bba6d859b63c92c4b4fe69c5b6b72d0cb897dbc8e6012298e6154cb56e" +checksum = "1bc1433177506450fe920e46a4f9812d0c211f5dd556da10e731a0a3dfa151f0" dependencies = [ "serde", "serde_spanned", @@ -1278,9 +1278,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95" +checksum = "ca676d9ba1a322c1b64eb8045a5ec5c0cfb0c9d08e15e9ff622589ad5221c8fe" dependencies = [ "indexmap 2.0.0", "serde", diff --git a/Cargo.toml b/Cargo.toml index 21be4bf6d..206ae0818 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-tarpaulin" -version = "0.27.0" +version = "0.27.1" authors = ["Daniel McKenna "] description = "Cargo-Tarpaulin is a tool to determine code coverage achieved via tests" repository = "https://github.com/xd009642/tarpaulin" diff --git a/README.md b/README.md index d9fd30183..e70c3c471 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,11 @@ Arguments: Options: --print-rust-flags Print the RUSTFLAGS options that tarpaulin will compile your program with and exit --print-rustdoc-flags Print the RUSTDOCFLAGS options that tarpaulin will compile any doctests with and exit - --color Coloring: auto, always, never [possible values: auto, always, never] + --color Coloring: auto, always, never [possible values: Auto, Always, Never] --debug Show debug output - this is used for diagnosing issues with tarpaulin - --verbose Show extra output + -v, --verbose Show extra output --dump-traces Log tracing events and save to a json file. Also, enabled when --debug is used - --run-types Type of the coverage run [possible values: tests, doctests, benchmarks, examples, lib, bins, all-targets] + --run-types Type of the coverage run [possible values: Tests, Doctests, Benchmarks, Examples, Lib, Bins, AllTargets] --benches Test all benches --doc Test only this library's documentation --all-targets Test all targets (excluding doctests) @@ -97,10 +97,10 @@ Options: --rustflags Rustflags to add when building project (can also be set via RUSTFLAGS env var) --objects [...] Other object files to load which contain information for llvm coverage - must have been compiled with llvm coverage instrumentation (ignored for ptrace) -Z [...] List of unstable nightly only flags - -o, --out [...] Output format of coverage report [possible values: json, stdout, xml, html, lcov] - --engine Coverage tracing backend to use [possible values: auto, ptrace, llvm] + -o, --out [...] Output format of coverage report [possible values: Json, Stdout, Xml, Html, Lcov] + --engine Coverage tracing backend to use [possible values: Auto, Ptrace, Llvm] --output-dir Specify a custom directory to write report files - --command cargo subcommand to run. So far only test and build are supported [possible values: test, build] + --command cargo subcommand to run. So far only test and build are supported [possible values: Test, Build] -r, --root Calculates relative paths to root directory. If --manifest-path isn't specified it will look for a Cargo.toml in root --manifest-path Path to Cargo.toml --ciserver CI server being used, if unspecified tarpaulin may automatically infer for coveralls uploads @@ -418,7 +418,7 @@ after_success: | # cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID # Uncomment the following two lines create and upload a report for codecov.io - # cargo tarpaulin --out Xml + # cargo tarpaulin --out xml # bash <(curl -s https://codecov.io/bash) fi ``` @@ -457,7 +457,7 @@ jobs: - name: Generate code coverage run: | - cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml + cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml - name: Upload to codecov.io uses: codecov/codecov-action@v2 @@ -599,7 +599,7 @@ its own report implementations. To generate a `cobertura.xml` simply run the following tarpaulin command: ```text -cargo tarpaulin --out Xml +cargo tarpaulin --out xml ``` Then install `pycobertura` with pip and execute the desired command. diff --git a/src/args.rs b/src/args.rs index c957ae6fd..4b1114900 100644 --- a/src/args.rs +++ b/src/args.rs @@ -181,16 +181,16 @@ pub struct ConfigArgs { #[arg(short = 'Z', value_name = "FEATURES", num_args = 0..)] pub unstable_features: Vec, /// Output format of coverage report - #[arg(long, short, value_enum, value_name = "FMT", num_args = 0..)] + #[arg(long, short, value_enum, value_name = "FMT", num_args = 0.., ignore_case = true)] pub out: Vec, /// Coverage tracing backend to use - #[arg(long, value_enum, value_name = "ENGINE")] + #[arg(long, value_enum, value_name = "ENGINE", ignore_case = true)] pub engine: Option, /// Specify a custom directory to write report files #[arg(long, value_name = "PATH")] pub output_dir: Option, /// cargo subcommand to run. So far only test and build are supported - #[arg(long, value_enum, value_name = "CMD")] + #[arg(long, value_enum, value_name = "CMD", ignore_case = true)] pub command: Option, /// Calculates relative paths to root directory. If --manifest-path isn't specified it will look for a Cargo.toml in root #[arg(long, short, value_name = "DIR")] @@ -212,13 +212,13 @@ pub struct ConfigArgs { #[derive(Debug, Clone, Copy, Args)] pub struct LoggingArgs { /// Coloring: auto, always, never - #[arg(long, value_enum, value_name = "WHEN")] + #[arg(long, value_enum, value_name = "WHEN", ignore_case = true)] pub color: Option, /// Show debug output - this is used for diagnosing issues with tarpaulin #[arg(long)] pub debug: bool, /// Show extra output - #[arg(long)] + #[arg(long, short)] pub verbose: bool, /// Log tracing events and save to a json file. Also, enabled when --debug is used #[arg(long)] @@ -238,7 +238,7 @@ pub struct PrintFlagsArgs { #[derive(Debug, Clone, Args)] pub struct RunTypesArgs { /// Type of the coverage run - #[arg(long, value_enum, value_name = "TYPE")] + #[arg(long, value_enum, value_name = "TYPE", ignore_case = true)] pub run_types: Vec, /// Test all benches #[arg(long)] diff --git a/src/config/types.rs b/src/config/types.rs index b207d45dc..ed477eef2 100644 --- a/src/config/types.rs +++ b/src/config/types.rs @@ -18,6 +18,7 @@ use std::str::FromStr; ValueEnum, EnumDisplay, )] +#[value(rename_all = "PascalCase")] pub enum Color { Auto, Always, @@ -27,6 +28,7 @@ pub enum Color { #[derive( Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum, )] +#[value(rename_all = "PascalCase")] pub enum TraceEngine { Auto, Ptrace, @@ -60,6 +62,7 @@ impl Default for TraceEngine { #[derive( Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum, )] +#[value(rename_all = "PascalCase")] pub enum Mode { Test, Build, @@ -68,6 +71,7 @@ pub enum Mode { #[derive( Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum, )] +#[value(rename_all = "PascalCase")] pub enum RunType { Tests, Doctests, @@ -81,6 +85,7 @@ pub enum RunType { #[derive( Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize, ValueEnum, )] +#[value(rename_all = "PascalCase")] #[non_exhaustive] pub enum OutputFile { Json,