From 109b75783825aa8dcc6b458d21c6f0242768d439 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Thu, 14 May 2026 14:44:35 +0100 Subject: [PATCH] fix(lint): remove blanket #![allow(...)] from main.rs and lib.rs Closes #16, closes #17. The blanket allow block was silencing 12 clippy lint categories across the whole crate. Restore clippy signal by removing the block, then fix each lint at the call site: - main.rs: replace `mod {abi,codegen,intercept,manifest,tier1,tier2};` with `use verisimiser::{abi, codegen, manifest};`. The binary crate was redeclaring the same modules as the library crate, which both duplicated the source and caused dead_code warnings on every library item the binary didn't happen to reference. Routing main through the lib crate eliminates the duplication and the warnings. - codegen/query.rs:124: collapse `format!("{}::text", format!(...))` nested call into a single `format!("{}.ctid::text", table_name)` (format_in_format_args). - manifest/mod.rs:309: the `if database == "sqlite" { "false" } else { "false" }` was a placeholder where both branches returned the same literal. Simulation is unimplemented across all backends; use a plain `let enable_simulation = "false";` with a comment noting the backend-dependent value should be added when simulation lands (if_same_then_else). `cargo clippy --all-targets -- -D warnings` is clean. All 26 unit tests pass. Co-Authored-By: Claude Opus 4.7 --- src/codegen/query.rs | 2 +- src/lib.rs | 14 -------------- src/main.rs | 22 +--------------------- src/manifest/mod.rs | 7 ++----- 4 files changed, 4 insertions(+), 41 deletions(-) diff --git a/src/codegen/query.rs b/src/codegen/query.rs index 86d1e3c..9f5f99a 100644 --- a/src/codegen/query.rs +++ b/src/codegen/query.rs @@ -121,7 +121,7 @@ fn build_entity_id_expr(pk_columns: &[&str], table_name: &str, backend: Database // No PK defined — fall back to internal row identifier. match backend { DatabaseBackend::SQLite => format!("{}.rowid", table_name), - DatabaseBackend::PostgreSQL => format!("{}::text", format!("{}.ctid", table_name)), + DatabaseBackend::PostgreSQL => format!("{}.ctid::text", table_name), DatabaseBackend::MongoDB => "CAST(_id AS TEXT)".to_string(), } } else if pk_columns.len() == 1 { diff --git a/src/lib.rs b/src/lib.rs index a584e89..38eba2c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,18 +1,4 @@ #![forbid(unsafe_code)] -#![allow( - dead_code, - clippy::too_many_arguments, - clippy::manual_strip, - clippy::if_same_then_else, - clippy::vec_init_then_push, - clippy::upper_case_acronyms, - clippy::format_in_format_args, - clippy::enum_variant_names, - clippy::module_inception, - clippy::doc_lazy_continuation, - clippy::manual_clamp, - clippy::type_complexity -)] // SPDX-License-Identifier: PMPL-1.0-or-later // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) // diff --git a/src/main.rs b/src/main.rs index bac3e96..534eaeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,3 @@ -#![allow( - dead_code, - clippy::too_many_arguments, - clippy::manual_strip, - clippy::if_same_then_else, - clippy::vec_init_then_push, - clippy::upper_case_acronyms, - clippy::format_in_format_args, - clippy::enum_variant_names, - clippy::module_inception, - clippy::doc_lazy_continuation, - clippy::manual_clamp, - clippy::type_complexity -)] #![forbid(unsafe_code)] // SPDX-License-Identifier: PMPL-1.0-or-later // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) @@ -31,13 +17,7 @@ use anyhow::Result; use clap::{Parser, Subcommand}; - -mod abi; -mod codegen; -mod intercept; -mod manifest; -mod tier1; -mod tier2; +use verisimiser::{abi, codegen, manifest}; /// VeriSimiser — augment any database with VeriSimDB octad capabilities. #[derive(Parser)] diff --git a/src/manifest/mod.rs b/src/manifest/mod.rs index c6a678b..803d7d8 100644 --- a/src/manifest/mod.rs +++ b/src/manifest/mod.rs @@ -306,11 +306,8 @@ pub fn init_manifest(database: &str) -> Result<()> { anyhow::bail!("{} already exists — remove it first to reinitialise", path); } - let enable_simulation = if database == "sqlite" { - "false" - } else { - "false" - }; + // Simulation is unimplemented across all backends; placeholder "false". + let enable_simulation = "false"; let template = format!( r#"# SPDX-License-Identifier: PMPL-1.0-or-later