Skip to content

Commit 2ab7565

Browse files
committed
chore: configure clippy cast lints at workspace level
1 parent 1f669ae commit 2ab7565

File tree

11 files changed

+33
-8
lines changed

11 files changed

+33
-8
lines changed

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ criterion = { version = "0.5.1", features = ["async_tokio"] }
187187
# Enable testing with SQLCipher if specifically requested.
188188
libsqlite3-sys = { version = "0.30.1", features = ["bundled-sqlcipher"] }
189189

190+
# Common lint settings for the workspace
191+
[workspace.lints.clippy]
192+
# https://github.com/launchbadge/sqlx/issues/3440
193+
cast_possible_truncation = 'deny'
194+
cast_possible_wrap = 'deny'
195+
cast_sign_loss = 'deny'
196+
# See `clippy.toml`
197+
disallowed_methods = 'deny'
198+
190199
#
191200
# Any
192201
#

sqlx-bench/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ required-features = ["postgres"]
4242
name = "sqlite_fetch_all"
4343
harness = false
4444
required-features = ["sqlite"]
45+
46+
[lints]
47+
workspace = true

sqlx-cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ completions = ["dep:clap_complete"]
6868
[dev-dependencies]
6969
assert_cmd = "2.0.11"
7070
tempfile = "3.10.1"
71+
72+
[lints]
73+
workspace = true

sqlx-core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ hashbrown = "0.14.5"
9494
[dev-dependencies]
9595
sqlx = { workspace = true, features = ["postgres", "sqlite", "mysql", "migrate", "macros", "time", "uuid"] }
9696
tokio = { version = "1", features = ["rt"] }
97+
98+
[lints]
99+
workspace = true

sqlx-core/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#![recursion_limit = "512"]
1616
#![warn(future_incompatible, rust_2018_idioms)]
1717
#![allow(clippy::needless_doctest_main, clippy::type_complexity)]
18-
// See `clippy.toml` at the workspace root
19-
#![deny(clippy::disallowed_methods)]
20-
#![deny(clippy::cast_possible_truncation)]
21-
#![deny(clippy::cast_possible_wrap)]
2218
// The only unsafe code in SQLx is that necessary to interact with native APIs like with SQLite,
2319
// and that can live in its own separate driver crate.
2420
#![forbid(unsafe_code)]

sqlx-macros/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ sqlx-macros-core = { workspace = true }
4949
proc-macro2 = { version = "1.0.36", default-features = false }
5050
syn = { version = "2.0.52", default-features = false, features = ["parsing", "proc-macro"] }
5151
quote = { version = "1.0.26", default-features = false }
52+
53+
[lints]
54+
workspace = true

sqlx-mysql/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ tracing = { version = "0.1.37", features = ["log"] }
7171
whoami = { version = "1.2.1", default-features = false }
7272

7373
serde = { version = "1.0.144", optional = true }
74+
75+
[lints]
76+
workspace = true

sqlx-postgres/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,6 @@ features = ["postgres", "derive"]
8383

8484
[target.'cfg(target_os = "windows")'.dependencies]
8585
etcetera = "0.8.0"
86+
87+
[lints]
88+
workspace = true

sqlx-postgres/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
//! **PostgreSQL** database driver.
2-
// https://github.com/launchbadge/sqlx/issues/3440
3-
#![deny(clippy::cast_possible_truncation)]
4-
#![deny(clippy::cast_possible_wrap)]
5-
#![deny(clippy::cast_sign_loss)]
62
73
#[macro_use]
84
extern crate sqlx_core;

sqlx-sqlite/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ workspace = true
6060

6161
[dev-dependencies]
6262
sqlx = { workspace = true, default-features = false, features = ["macros", "runtime-tokio", "tls-none"] }
63+
64+
[lints]
65+
workspace = true

sqlx-test/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ sqlx = { default-features = false, path = ".." }
99
env_logger = "0.11"
1010
dotenvy = "0.15.0"
1111
anyhow = "1.0.26"
12+
13+
[lints]
14+
workspace = true

0 commit comments

Comments
 (0)