Skip to content

Commit 212a6a5

Browse files
fix(lint): remove blanket #![allow(...)] from main.rs and lib.rs (#68)
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 <noreply@anthropic.com>
1 parent 683ae35 commit 212a6a5

4 files changed

Lines changed: 4 additions & 41 deletions

File tree

src/codegen/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn build_entity_id_expr(pk_columns: &[&str], table_name: &str, backend: Database
121121
// No PK defined — fall back to internal row identifier.
122122
match backend {
123123
DatabaseBackend::SQLite => format!("{}.rowid", table_name),
124-
DatabaseBackend::PostgreSQL => format!("{}::text", format!("{}.ctid", table_name)),
124+
DatabaseBackend::PostgreSQL => format!("{}.ctid::text", table_name),
125125
DatabaseBackend::MongoDB => "CAST(_id AS TEXT)".to_string(),
126126
}
127127
} else if pk_columns.len() == 1 {

src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
#![forbid(unsafe_code)]
2-
#![allow(
3-
dead_code,
4-
clippy::too_many_arguments,
5-
clippy::manual_strip,
6-
clippy::if_same_then_else,
7-
clippy::vec_init_then_push,
8-
clippy::upper_case_acronyms,
9-
clippy::format_in_format_args,
10-
clippy::enum_variant_names,
11-
clippy::module_inception,
12-
clippy::doc_lazy_continuation,
13-
clippy::manual_clamp,
14-
clippy::type_complexity
15-
)]
162
// SPDX-License-Identifier: PMPL-1.0-or-later
173
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
184
//

src/main.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
#![allow(
2-
dead_code,
3-
clippy::too_many_arguments,
4-
clippy::manual_strip,
5-
clippy::if_same_then_else,
6-
clippy::vec_init_then_push,
7-
clippy::upper_case_acronyms,
8-
clippy::format_in_format_args,
9-
clippy::enum_variant_names,
10-
clippy::module_inception,
11-
clippy::doc_lazy_continuation,
12-
clippy::manual_clamp,
13-
clippy::type_complexity
14-
)]
151
#![forbid(unsafe_code)]
162
// SPDX-License-Identifier: PMPL-1.0-or-later
173
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
@@ -31,13 +17,7 @@
3117

3218
use anyhow::Result;
3319
use clap::{Parser, Subcommand};
34-
35-
mod abi;
36-
mod codegen;
37-
mod intercept;
38-
mod manifest;
39-
mod tier1;
40-
mod tier2;
20+
use verisimiser::{abi, codegen, manifest};
4121

4222
/// VeriSimiser — augment any database with VeriSimDB octad capabilities.
4323
#[derive(Parser)]

src/manifest/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,8 @@ pub fn init_manifest(database: &str) -> Result<()> {
306306
anyhow::bail!("{} already exists — remove it first to reinitialise", path);
307307
}
308308

309-
let enable_simulation = if database == "sqlite" {
310-
"false"
311-
} else {
312-
"false"
313-
};
309+
// Simulation is unimplemented across all backends; placeholder "false".
310+
let enable_simulation = "false";
314311

315312
let template = format!(
316313
r#"# SPDX-License-Identifier: PMPL-1.0-or-later

0 commit comments

Comments
 (0)