From ca447df5258a90dd1a763d7e8d9b8c305dc0e9df Mon Sep 17 00:00:00 2001 From: Bauke Date: Mon, 3 Oct 2022 00:07:12 +0200 Subject: [PATCH] Update to new project style. --- .gitignore | 12 ++++-------- Cargo.toml | 16 ++++++++-------- Makefile.toml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 Makefile.toml diff --git a/.gitignore b/.gitignore index 088ba6b..fbbabcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,6 @@ # Generated by Cargo -# will have compiled files and executables -/target/ +debug/ +target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk +# Code coverage results +coverage/ diff --git a/Cargo.toml b/Cargo.toml index 365dccf..44b4b7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,18 +2,18 @@ [package] name = "web-ext-native-messaging" -description = "WebExtension native messaging with serde_json as the (de)serializer." -version = "0.1.0" -authors = ["Holllo "] +description = "WebExtension native messaging library for Rust." +repository = "https://git.bauke.xyz/Holllo/web-ext-native-messaging" license = "MIT OR Apache-2.0" -repository = "https://github.com/Holllo/web-ext-native-messaging" -edition = "2018" +version = "0.1.0" +authors = ["Holllo "] +edition = "2021" [lib] path = "source/lib.rs" [dependencies] byteorder = "1.4.3" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -thiserror = "1.0" +serde = { version = "1.0.145", features = ["derive"] } +serde_json = "1.0.85" +thiserror = "1.0.37" diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..d640ca1 --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,39 @@ +[tasks.fmt] +command = "cargo" +args = ["fmt", "${@}"] + +[tasks.check] +command = "cargo" +args = ["check", "${@}"] + +[tasks.clippy] +command = "cargo" +args = ["clippy", "${@}"] + +[tasks.test] +command = "cargo" +args = ["test", "${@}"] + +[tasks.doc] +command = "cargo" +args = ["doc", "${@}"] + +[tasks.build] +command = "cargo" +args = ["build", "${@}"] + +[tasks.complete-check] +dependencies = ["fmt", "check", "clippy", "test", "doc", "build"] + +[tasks.code-coverage] +workspace = false +install_crate = "cargo-tarpaulin" +command = "cargo" +args = [ + "tarpaulin", + "--exclude-files=target/*", + "--out=html", + "--output-dir=coverage", + "--skip-clean", + "--target-dir=target/tarpaulin" +]