From 1ee2143f5925b1cce189ab663bcfa47bb38d6a18 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:18:40 +0000 Subject: [PATCH] Enable additional rustc and Clippy lints (#176) Enables some off-by-default lints that we already use in the `libcnb.rs` repository. https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unsafe-code https://rust-lang.github.io/rust-clippy/master/index.html#/panic_in_result_fn https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_used GUS-W-14523770. --- Cargo.toml | 4 ++++ clippy.toml | 1 + src/main.rs | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 clippy.toml diff --git a/Cargo.toml b/Cargo.toml index 1ca258c6..45db0427 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,14 @@ path = "src/main.rs" strip = true [lints.rust] +unreachable_pub = "warn" +unsafe_code = "warn" unused_crate_dependencies = "warn" [lints.clippy] +panic_in_result_fn = "warn" pedantic = "warn" +unwrap_used = "warn" [dependencies] chrono = "0.4" diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 00000000..154626ef --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +allow-unwrap-in-tests = true diff --git a/src/main.rs b/src/main.rs index afec2ce8..006bdbc1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ const UNSPECIFIED_ERROR: i32 = 1; #[derive(Parser)] #[command(bin_name = "actions")] -pub(crate) enum Cli { +enum Cli { GenerateBuildpackMatrix(GenerateBuildpackMatrixArgs), GenerateChangelog(GenerateChangelogArgs), PrepareRelease(PrepareReleaseArgs),