From 15f7928551435458e2991dde3a76ce71e8a32057 Mon Sep 17 00:00:00 2001 From: Jorge Hermo Date: Wed, 15 Jan 2025 23:23:12 +0100 Subject: [PATCH] chore: enable all features in clippy ci and fix more clippy lints --- .github/workflows/rust.yml | 2 +- core/benches/benchmark.rs | 1 + core/json/json_path.rs | 2 +- vendored/sqlite3-parser/Cargo.toml | 6 +++++- vendored/sqlite3-parser/third_party/lemon/lempar.rs | 6 +++--- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c7df4d187..91ecadbfb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v3 - name: Clippy run: | - cargo clippy -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings + cargo clippy --all-targets --all-features -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings build-wasm: runs-on: ubuntu-latest diff --git a/core/benches/benchmark.rs b/core/benches/benchmark.rs index 0d6db46de..184deac4a 100644 --- a/core/benches/benchmark.rs +++ b/core/benches/benchmark.rs @@ -18,6 +18,7 @@ fn bench(c: &mut Criterion) { fn limbo_bench(criterion: &mut Criterion) { let mut group = criterion.benchmark_group("limbo"); group.throughput(Throughput::Elements(1)); + #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); let db = Database::open_file(io.clone(), "../testing/testing.db").unwrap(); let conn = db.connect(); diff --git a/core/json/json_path.rs b/core/json/json_path.rs index b16eed092..ed8981018 100644 --- a/core/json/json_path.rs +++ b/core/json/json_path.rs @@ -122,7 +122,7 @@ mod tests { let path = json_path(value); match path { - Err(crate::error::LimboError::Constraint(e)) => { + Err(crate::error::LimboError::Constraint(_)) => { // happy path } _ => panic!("Expected error for: {:?}, got: {:?}", value, path), diff --git a/vendored/sqlite3-parser/Cargo.toml b/vendored/sqlite3-parser/Cargo.toml index 90177820d..87f245fa1 100644 --- a/vendored/sqlite3-parser/Cargo.toml +++ b/vendored/sqlite3-parser/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" categories = ["parser-implementations"] keywords = ["sql", "parser", "scanner", "tokenizer"] license = "Apache-2.0/MIT" -build = "build.rs" # Lemon preprocessing +build = "build.rs" # Lemon preprocessing [badges] maintenance = { status = "experimental" } @@ -41,3 +41,7 @@ cc = "1.0" phf_shared = { version = "0.11", features = ["uncased"] } phf_codegen = "0.11" uncased = "0.9.10" + +[lints.rust] +dead_code = "allow" +non_snake_case = "allow" diff --git a/vendored/sqlite3-parser/third_party/lemon/lempar.rs b/vendored/sqlite3-parser/third_party/lemon/lempar.rs index 4bee616f4..a45575ba4 100644 --- a/vendored/sqlite3-parser/third_party/lemon/lempar.rs +++ b/vendored/sqlite3-parser/third_party/lemon/lempar.rs @@ -354,8 +354,8 @@ impl yyParser<'_> { ** is in state X and has a lookahead token Y. In a well-tested ** systems, every element of this matrix should end up being set. */ -#[cfg(feature = "YYCOVERAGE")] -static yycoverage: [[bool; YYNTOKEN]; YYNSTATE] = []; +// #[cfg(feature = "YYCOVERAGE")] +// static yycoverage: [[bool; YYNTOKEN]; YYNSTATE] = []; /* ** Write into out a description of every state/lookahead combination that @@ -368,7 +368,7 @@ static yycoverage: [[bool; YYNTOKEN]; YYNSTATE] = []; #[cfg(feature = "YYCOVERAGE")] fn ParseCoverage(/*FILE *out*/) -> i32 { //int stateno, iLookAhead, i; - let mut nMissed = 0; + let nMissed = 0; /*for(stateno=0; stateno