From d79ca62bc341fc0044f8a45e803613d89caa4c9a Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Thu, 3 Oct 2024 12:27:01 +0200 Subject: [PATCH 1/2] clippy: refactor to define lints in Cargo.toml manifest --- .github/workflows/testing.yaml | 2 +- .vscode/settings.json | 15 --------------- Cargo.toml | 8 ++++++++ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 4c3dfebc..590c7212 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -73,7 +73,7 @@ jobs: - id: lint name: Run Lint Checks - run: cargo clippy --tests --benches --examples --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious -D clippy::complexity -D clippy::perf -D clippy::style -D clippy::pedantic + run: cargo clippy --tests --benches --examples --workspace --all-targets --all-features - id: docs name: Lint Documentation diff --git a/.vscode/settings.json b/.vscode/settings.json index 661243fb..83d103e1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,21 +5,6 @@ "rust-analyzer.checkOnSave": true, "rust-analyzer.check.command": "clippy", "rust-analyzer.check.allTargets": true, - "rust-analyzer.check.extraArgs": [ - "--", - "-D", - "clippy::correctness", - "-D", - "clippy::suspicious", - "-W", - "clippy::complexity", - "-W", - "clippy::perf", - "-W", - "clippy::style", - "-W", - "clippy::pedantic", - ], "evenBetterToml.formatter.allowedBlankLines": 1, "evenBetterToml.formatter.columnWidth": 130, "evenBetterToml.formatter.trailingNewline": true, diff --git a/Cargo.toml b/Cargo.toml index 7750a18c..ecf9c7d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,3 +103,11 @@ uuid = { version = "1", features = ["v4"] } tempfile = "3" uuid = { version = "1", features = ["v4"] } which = "6" + +[lints.clippy] +complexity = { level = "deny", priority = -1 } +correctness = { level = "deny", priority = -1 } +pedantic = { level = "deny", priority = -1 } +perf = { level = "deny", priority = -1 } +style = { level = "deny", priority = -1 } +suspicious = { level = "deny", priority = -1 } From 697c69389751ccbfd9030e975fee3c74bef65fb8 Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Thu, 3 Oct 2024 12:28:04 +0200 Subject: [PATCH 2/2] ci: make tempory exception for lint --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ecf9c7d7..de773bd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,3 +111,6 @@ pedantic = { level = "deny", priority = -1 } perf = { level = "deny", priority = -1 } style = { level = "deny", priority = -1 } suspicious = { level = "deny", priority = -1 } + +# temp allow this lint +needless_return = "allow"