chore: configure clippy cast lints at workspace level

This commit is contained in:
Austin Bonander 2024-08-20 01:26:53 -07:00
parent 1f669ae996
commit 2ab7565bd8
11 changed files with 33 additions and 8 deletions

View file

@ -187,6 +187,15 @@ criterion = { version = "0.5.1", features = ["async_tokio"] }
# Enable testing with SQLCipher if specifically requested.
libsqlite3-sys = { version = "0.30.1", features = ["bundled-sqlcipher"] }
# Common lint settings for the workspace
[workspace.lints.clippy]
# https://github.com/launchbadge/sqlx/issues/3440
cast_possible_truncation = 'deny'
cast_possible_wrap = 'deny'
cast_sign_loss = 'deny'
# See `clippy.toml`
disallowed_methods = 'deny'
#
# Any
#

View file

@ -42,3 +42,6 @@ required-features = ["postgres"]
name = "sqlite_fetch_all"
harness = false
required-features = ["sqlite"]
[lints]
workspace = true

View file

@ -68,3 +68,6 @@ completions = ["dep:clap_complete"]
[dev-dependencies]
assert_cmd = "2.0.11"
tempfile = "3.10.1"
[lints]
workspace = true

View file

@ -94,3 +94,6 @@ hashbrown = "0.14.5"
[dev-dependencies]
sqlx = { workspace = true, features = ["postgres", "sqlite", "mysql", "migrate", "macros", "time", "uuid"] }
tokio = { version = "1", features = ["rt"] }
[lints]
workspace = true

View file

@ -15,10 +15,6 @@
#![recursion_limit = "512"]
#![warn(future_incompatible, rust_2018_idioms)]
#![allow(clippy::needless_doctest_main, clippy::type_complexity)]
// See `clippy.toml` at the workspace root
#![deny(clippy::disallowed_methods)]
#![deny(clippy::cast_possible_truncation)]
#![deny(clippy::cast_possible_wrap)]
// The only unsafe code in SQLx is that necessary to interact with native APIs like with SQLite,
// and that can live in its own separate driver crate.
#![forbid(unsafe_code)]

View file

@ -49,3 +49,6 @@ sqlx-macros-core = { workspace = true }
proc-macro2 = { version = "1.0.36", default-features = false }
syn = { version = "2.0.52", default-features = false, features = ["parsing", "proc-macro"] }
quote = { version = "1.0.26", default-features = false }
[lints]
workspace = true

View file

@ -71,3 +71,6 @@ tracing = { version = "0.1.37", features = ["log"] }
whoami = { version = "1.2.1", default-features = false }
serde = { version = "1.0.144", optional = true }
[lints]
workspace = true

View file

@ -83,3 +83,6 @@ features = ["postgres", "derive"]
[target.'cfg(target_os = "windows")'.dependencies]
etcetera = "0.8.0"
[lints]
workspace = true

View file

@ -1,8 +1,4 @@
//! **PostgreSQL** database driver.
// https://github.com/launchbadge/sqlx/issues/3440
#![deny(clippy::cast_possible_truncation)]
#![deny(clippy::cast_possible_wrap)]
#![deny(clippy::cast_sign_loss)]
#[macro_use]
extern crate sqlx_core;

View file

@ -60,3 +60,6 @@ workspace = true
[dev-dependencies]
sqlx = { workspace = true, default-features = false, features = ["macros", "runtime-tokio", "tls-none"] }
[lints]
workspace = true

View file

@ -9,3 +9,6 @@ sqlx = { default-features = false, path = ".." }
env_logger = "0.11"
dotenvy = "0.15.0"
anyhow = "1.0.26"
[lints]
workspace = true