From 6f855319666548320398559194677c0a312718c7 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Sun, 15 Dec 2024 23:31:37 -0500 Subject: [PATCH] lints --- Cargo.lock | 41 ++++++++++++++++++++-------------------- clippy.toml | 6 ++++++ tests/compat/Cargo.toml | 14 ++++---------- tests/compat/src/cli.rs | 12 ++++++++++-- tests/compat/src/main.rs | 4 ---- 5 files changed, 41 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6efecf0..2727e50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1150,6 +1150,27 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "cuprate-tests-compat" +version = "0.0.0" +dependencies = [ + "clap", + "crossbeam", + "cuprate-consensus-rules", + "cuprate-constants", + "cuprate-cryptonight", + "futures", + "hex", + "hex-literal", + "monero-serai", + "randomx-rs", + "rayon", + "reqwest", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "cuprate-txpool" version = "0.0.0" @@ -3380,26 +3401,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "tests-compat" -version = "0.0.0" -dependencies = [ - "clap", - "crossbeam", - "cuprate-consensus-rules", - "cuprate-cryptonight", - "futures", - "hex", - "hex-literal", - "monero-serai", - "randomx-rs", - "rayon", - "reqwest", - "serde", - "serde_json", - "tokio", -] - [[package]] name = "thiserror" version = "1.0.66" diff --git a/clippy.toml b/clippy.toml index cc94ec5..ec06052 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1,7 @@ +# upper-case-acronyms-aggressive = true + +# +doc-valid-idents = [ + "RandomX", ".." +] diff --git a/tests/compat/Cargo.toml b/tests/compat/Cargo.toml index 15d8bc8..9678cfb 100644 --- a/tests/compat/Cargo.toml +++ b/tests/compat/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tests-compat" +name = "cuprate-tests-compat" version = "0.0.0" edition = "2021" description = "Compatability tests between `cuprated` and `monerod`" @@ -10,10 +10,11 @@ keywords = ["cuprate", "tests", "compat"] [dependencies] +cuprate-constants = { workspace = true, features = ["build",] } cuprate-consensus-rules = { workspace = true } cuprate-cryptonight = { workspace = true } -clap = { workspace = true, features = ["cargo", "derive", "default"] } +clap = { workspace = true, features = ["cargo", "derive", "default", "string"] } crossbeam = { workspace = true, features = ["std"] } futures = { workspace = true, features = ["std"] } monero-serai = { workspace = true } @@ -27,11 +28,4 @@ reqwest = { workspace = true, features = ["json"] } randomx-rs = { workspace = true } [lints] -workspace = true - -[profile.release] -panic = "unwind" -lto = true -strip = "none" -codegen-units = 1 -opt-level = 3 \ No newline at end of file +workspace = true \ No newline at end of file diff --git a/tests/compat/src/cli.rs b/tests/compat/src/cli.rs index 5cd89c1..ed9dda9 100644 --- a/tests/compat/src/cli.rs +++ b/tests/compat/src/cli.rs @@ -2,9 +2,17 @@ use std::num::{NonZeroU64, NonZeroUsize}; use clap::Parser; -/// `cuprate` <-> `monerod` compatability tester. +/// `cuprate` <-> `monerod` compatibility tester. #[derive(Parser, Debug)] -#[command(about, long_about = None)] +#[command( + about, + long_about = None, + long_version = format!( + "{} {}", + clap::crate_version!(), + cuprate_constants::build::COMMIT + ), +)] pub struct Args { /// Name of the person to greet #[arg(short, long, default_value_t = String::from("http://127.0.0.1:18081"))] diff --git a/tests/compat/src/main.rs b/tests/compat/src/main.rs index 1b8034e..21767a0 100644 --- a/tests/compat/src/main.rs +++ b/tests/compat/src/main.rs @@ -1,7 +1,3 @@ -#![allow( - clippy::doc_markdown, - reason = "TODO: add exception to doc clippy for `RandomX`" -)] #![allow(unreachable_pub, reason = "This is a binary, everything `pub` is ok")] mod cli;