From 57ff938533765b1a9e6f1a6dc9e621b4b4835f79 Mon Sep 17 00:00:00 2001 From: carneiro-cw <156914855+carneiro-cw@users.noreply.github.com> Date: Fri, 27 Dec 2024 13:51:34 -0300 Subject: [PATCH] lint: warn panics, expects and unwraps (#1932) --- .clippy.toml | 4 +++- Cargo.toml | 2 ++ justfile | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index 83ea73519..4fdd8fe0b 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1,2 +1,4 @@ allow-unwrap-in-tests = true -disallowed-names = ["lock"] \ No newline at end of file +allow-expect-in-tests = true +allow-panic-in-tests = true +disallowed-names = ["lock"] diff --git a/Cargo.toml b/Cargo.toml index 741cbefb4..ff9c8a831 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -232,3 +232,5 @@ unused_self = "warn" used_underscore_binding = "warn" wildcard_imports = "warn" unwrap_used = "allow" +expect_used = "warn" +panic = "warn" diff --git a/justfile b/justfile index a66ad4e6e..fdda4eb80 100644 --- a/justfile +++ b/justfile @@ -63,8 +63,8 @@ lint: @just _lint # Stratus: Lint and check code formatting -lint-check nightly-version="": - @just _lint "{{nightly-version}}" --check "-D warnings" +lint-check nightly-version="" clippy-flags="-D warnings -A clippy::unwrap_used -A clippy::expect_used -A clippy::panic": + @just _lint "{{nightly-version}}" --check "{{ clippy-flags }}" # Stratus: Check for dependencies major updates outdated: