diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 7013792..413c89f 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -3,6 +3,10 @@ name = "flatcitybuf" version = "0.1.0" edition = "2021" +[workspace.lints.clippy] +absolute_path = "warn" +nursery = { level = "warn", priority = -1 } + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/rust/makefile b/src/rust/makefile index fed4527..3e6f6db 100644 --- a/src/rust/makefile +++ b/src/rust/makefile @@ -5,7 +5,7 @@ pre-commit: cargo fmt cargo clippy --fix --allow-dirty cargo machete - cargo test + cargo nextest run cargo check --all-features cargo build --release diff --git a/src/rust/src/main.rs b/src/rust/src/main.rs index 43b2f16..0de27f3 100644 --- a/src/rust/src/main.rs +++ b/src/rust/src/main.rs @@ -183,3 +183,14 @@ fn main() -> Result<()> { Commands::Info { input } => show_info(input), } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn verify_cli() { + use clap::CommandFactory; + Cli::command().debug_assert(); + } +} diff --git a/src/rust/src/reader/geom_decoder.rs b/src/rust/src/reader/geom_decoder.rs index ef6db0f..761c4f5 100644 --- a/src/rust/src/reader/geom_decoder.rs +++ b/src/rust/src/reader/geom_decoder.rs @@ -393,6 +393,7 @@ mod tests { }, serializer::to_geometry, }; + use pretty_assertions::assert_eq; use super::*; use anyhow::Result; diff --git a/src/rust/src/writer/attribute.rs b/src/rust/src/writer/attribute.rs index f0712d1..36b9387 100644 --- a/src/rust/src/writer/attribute.rs +++ b/src/rust/src/writer/attribute.rs @@ -188,6 +188,7 @@ mod tests { use super::*; use anyhow::Result; + use pretty_assertions::assert_eq; use serde_json::json; #[test] diff --git a/src/rust/src/writer/geom_encoder.rs b/src/rust/src/writer/geom_encoder.rs index c4d3431..9273d4d 100644 --- a/src/rust/src/writer/geom_encoder.rs +++ b/src/rust/src/writer/geom_encoder.rs @@ -191,6 +191,7 @@ mod tests { use super::*; use anyhow::Result; use cjseq::Geometry as CjGeometry; + use pretty_assertions::assert_eq; use serde_json::json; diff --git a/src/rust/src/writer/serializer.rs b/src/rust/src/writer/serializer.rs index 1dead34..8792bdf 100644 --- a/src/rust/src/writer/serializer.rs +++ b/src/rust/src/writer/serializer.rs @@ -623,6 +623,7 @@ mod tests { use anyhow::Result; use cjseq::CityJSONFeature; use flatbuffers::FlatBufferBuilder; + use pretty_assertions::assert_eq; #[test] fn test_to_fcb_city_feature() -> Result<()> { diff --git a/src/rust/tests/e2e.rs b/src/rust/tests/e2e.rs index 5d384e0..b746df7 100644 --- a/src/rust/tests/e2e.rs +++ b/src/rust/tests/e2e.rs @@ -5,6 +5,7 @@ use flatcitybuf::{ header_writer::HeaderWriterOptions, read_cityjson_from_reader, CJType, CJTypeKind, FcbReader, FcbWriter, }; +use pretty_assertions::assert_eq; use std::{ fs::File, io::{BufReader, BufWriter},