From f17bd9254a097b4990a78102ea98c6a7d1d9ced3 Mon Sep 17 00:00:00 2001 From: Samir Talwar Date: Mon, 11 Mar 2024 10:31:41 +0100 Subject: [PATCH] Align the Justfile with CI. --- Cargo.lock | 131 +++-------------------------------------------------- flake.nix | 2 + justfile | 19 +++++--- 3 files changed, 20 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5fac5e9e..9a0fc354 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,37 +394,14 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -441,24 +418,13 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.3", + "darling_core", "quote", "syn 2.0.38", ] @@ -634,19 +600,6 @@ dependencies = [ "slab", ] -[[package]] -name = "gdc_rust_types" -version = "1.0.2" -source = "git+https://github.com/hasura/gdc_rust_types.git?rev=3273434#3273434068400f836cf12ea08c514505446821cb" -dependencies = [ - "indexmap 2.1.0", - "openapiv3", - "serde", - "serde-enum-str", - "serde_json", - "serde_with 3.3.0", -] - [[package]] name = "getrandom" version = "0.2.10" @@ -1038,7 +991,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with 2.3.3", + "serde_with", "url", ] @@ -1052,10 +1005,8 @@ dependencies = [ "axum-test-helper", "bytes", "clap", - "gdc_rust_types", "goldenfile", "http", - "indexmap 2.1.0", "mime", "ndc-client", "ndc-test", @@ -1141,17 +1092,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" -[[package]] -name = "openapiv3" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75e56d5c441965b6425165b7e3223cc933ca469834f4a8b4786817a1f9dc4f13" -dependencies = [ - "indexmap 1.9.3", - "serde", - "serde_json", -] - [[package]] name = "openssl" version = "0.10.57" @@ -1685,36 +1625,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-attributes" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb8ec7724e4e524b2492b510e66957fe1a2c76c26a6975ec80823f2439da685" -dependencies = [ - "darling_core 0.14.4", - "serde-rename-rule", - "syn 1.0.109", -] - -[[package]] -name = "serde-enum-str" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26416dc95fcd46b0e4b12a3758043a229a6914050aaec2e8191949753ed4e9aa" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "serde-attributes", - "syn 1.0.109", -] - -[[package]] -name = "serde-rename-rule" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794e44574226fc701e3be5c651feb7939038fc67fb73f6f4dd5c4ba90fd3be70" - [[package]] name = "serde_derive" version = "1.0.192" @@ -1783,24 +1693,7 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "serde_with_macros 2.3.3", - "time", -] - -[[package]] -name = "serde_with" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" -dependencies = [ - "base64 0.21.5", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.1.0", - "serde", - "serde_json", - "serde_with_macros 3.3.0", + "serde_with_macros", "time", ] @@ -1810,19 +1703,7 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.3", - "proc-macro2", - "quote", - "syn 2.0.38", -] - -[[package]] -name = "serde_with_macros" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" -dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", "syn 2.0.38", diff --git a/flake.nix b/flake.nix index cd48b27b..1e7959bf 100644 --- a/flake.nix +++ b/flake.nix @@ -35,6 +35,8 @@ pkgs.rustPlatform.rustcSrc pkgs.rustc pkgs.rustfmt + + pkgs.just ]; buildInputs = pkgs.lib.optionals pkgs.stdenv.isDarwin [ diff --git a/justfile b/justfile index cdd09d29..958d23a6 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,8 @@ +check: format-check build lint test + +build: + cargo build --all-targets --all-features + # re-build on code changes, and run the reference agent each time a build is # successful dev: @@ -7,17 +12,17 @@ dev: -- serve --configuration <(echo 'null') \ --otlp-endpoint http://localhost:4317' -# reformat everything format: cargo fmt --all -# is everything formatted? format-check: cargo fmt --all --check -# run `clippy` linter -lint *FLAGS: - cargo clippy {{FLAGS}} +lint: + cargo clippy --all-targets --all-features + +lint-apply: + cargo clippy --fix --all-targets --all-features -lint-apply *FLAGS: - cargo clippy --fix {{FLAGS}} +test: + cargo test --all-targets --all-features