diff --git a/Cargo.toml b/Cargo.toml index 3bbdfec1..8ba8382a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,17 @@ rust-version = "1.65" readme = "README.md" homepage = "https://martin.maplibre.org/" +[workspace.lints.rust] +unsafe_code = "forbid" + +[workspace.lints.clippy] +pedantic = "warn" +derive_partial_eq_without_eq = "allow" +implicit_hasher = "allow" +missing_errors_doc = "allow" +missing_panics_doc = "allow" +module_name_repetitions = "allow" + [workspace.dependencies] actix-cors = "0.6" actix-http = "3" diff --git a/martin-tile-utils/Cargo.toml b/martin-tile-utils/Cargo.toml index 4d60a9d3..2b413a94 100644 --- a/martin-tile-utils/Cargo.toml +++ b/martin-tile-utils/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "martin-tile-utils" version = "0.1.4" diff --git a/martin-tile-utils/src/lib.rs b/martin-tile-utils/src/lib.rs index ceb8a5ab..9caa1f84 100644 --- a/martin-tile-utils/src/lib.rs +++ b/martin-tile-utils/src/lib.rs @@ -211,7 +211,7 @@ mod tests { #[test] fn test_data_format_webp() { assert_eq!(detect("./fixtures/dc.webp"), info(Webp, Internal)); - assert_eq!(TileInfo::detect(br#"RIFF"#), None); + assert_eq!(TileInfo::detect(br"RIFF"), None); } #[test] diff --git a/martin/Cargo.toml b/martin/Cargo.toml index fc36ced5..24cc55e8 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "martin" # Once the release is published with the hash, update https://github.com/maplibre/homebrew-martin diff --git a/martin/src/lib.rs b/martin/src/lib.rs index 1feb9843..742ccbac 100644 --- a/martin/src/lib.rs +++ b/martin/src/lib.rs @@ -1,13 +1,4 @@ #![doc = include_str!("../README.md")] -#![forbid(unsafe_code)] -#![warn(clippy::pedantic)] -// Bounds struct derives PartialEq, but not Eq, -// so all containing types must also derive PartialEq without Eq -#![allow(clippy::derive_partial_eq_without_eq)] -#![allow(clippy::implicit_hasher)] -#![allow(clippy::missing_errors_doc)] -#![allow(clippy::missing_panics_doc)] -#![allow(clippy::module_name_repetitions)] pub mod args; mod config; diff --git a/mbtiles/Cargo.toml b/mbtiles/Cargo.toml index 93bdd0d2..3419575b 100644 --- a/mbtiles/Cargo.toml +++ b/mbtiles/Cargo.toml @@ -52,3 +52,16 @@ path = "src/lib.rs" name = "mbtiles" path = "src/bin/main.rs" required-features = ["cli"] + +# Lints inheritance from workspace is not yet supported +# Copy/pasting the list, modifying the `unsafe_code` requirement +[lints.rust] +unsafe_code = "allow" + +[lints.clippy] +pedantic = "warn" +derive_partial_eq_without_eq = "allow" +implicit_hasher = "allow" +missing_errors_doc = "allow" +missing_panics_doc = "allow" +module_name_repetitions = "allow" diff --git a/mbtiles/src/lib.rs b/mbtiles/src/lib.rs index 0f9397a8..c6433b79 100644 --- a/mbtiles/src/lib.rs +++ b/mbtiles/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] -#![allow(clippy::missing_errors_doc)] mod copier; pub use copier::{CopyDuplicateMode, MbtilesCopier}; diff --git a/mbtiles/src/mbtiles.rs b/mbtiles/src/mbtiles.rs index e05a198a..a73b1428 100644 --- a/mbtiles/src/mbtiles.rs +++ b/mbtiles/src/mbtiles.rs @@ -1,5 +1,3 @@ -#![allow(clippy::missing_errors_doc)] - use std::ffi::OsStr; use std::fmt::{Display, Formatter}; use std::path::Path;