diff --git a/Cargo.lock b/Cargo.lock index f6d019e18..ff9acdbf6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4778,9 +4778,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vectorscan-rs" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06868c1e9994efb8427457f188412c5e0e3ca65db41ad6d038bc2e9cc15a2076" +checksum = "08996b325141e4f10b5a7a52593490af2eea87e47f8bc1e8800b6d6e0dfb7050" dependencies = [ "bitflags 2.6.0", "foreign-types 0.5.0", @@ -4791,9 +4791,9 @@ dependencies = [ [[package]] name = "vectorscan-rs-sys" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38526b2bac42a703411a1784062a86a2b076e959a5c4e1c004212f56407064d1" +checksum = "473f4b86c4c9e42140712b9790079bca554f6341c8ce19f0f1a3ad3b9509dbd5" dependencies = [ "cmake", "flate2", diff --git a/crates/noseyparker-cli/Cargo.toml b/crates/noseyparker-cli/Cargo.toml index f598190a5..35680a4f2 100644 --- a/crates/noseyparker-cli/Cargo.toml +++ b/crates/noseyparker-cli/Cargo.toml @@ -108,7 +108,7 @@ tracing = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["tracing-log", "ansi", "env-filter", "smallvec", "fmt"], default-features = false } url = "2.3" -vectorscan-rs = { version = "0.0.4" } +vectorscan-rs = { version = "0.0.5" } object-pool = "0.6.0" parquet = { version = "53.2.0", optional = true } arrow-schema = { version = "53.2.0", optional = true } diff --git a/crates/noseyparker-cli/src/cmd_rules/cmd_rules_check.rs b/crates/noseyparker-cli/src/cmd_rules/cmd_rules_check.rs index c55c49666..15668effd 100644 --- a/crates/noseyparker-cli/src/cmd_rules/cmd_rules_check.rs +++ b/crates/noseyparker-cli/src/cmd_rules/cmd_rules_check.rs @@ -1,7 +1,7 @@ use anyhow::{bail, Context, Result}; use regex::Regex; use std::collections::HashSet; -use tracing::{error, error_span, info, warn}; +use tracing::{debug, error, error_span, info, warn}; use vectorscan_rs::{BlockDatabase, Flag, Pattern, Scan}; use noseyparker::rules_database::RulesDatabase; @@ -269,12 +269,15 @@ fn check_rule(rule: &Rule, args: &RulesCheckArgs) -> Result { } }; - match hs_compile_pattern(&syntax.uncommented_pattern()) { + let uncommented_pattern = syntax.uncommented_pattern(); + match hs_compile_pattern(&uncommented_pattern) { Err(e) => { error!("Vectorscan: failed to compile pattern: {e}"); num_errors += 1; } Ok(db) => { + debug!("{} regex bytes -> {} vectorscan bytes", uncommented_pattern.len(), db.size()?); + let mut scanner = vectorscan_rs::BlockScanner::new(&db)?; let mut num_succeeded = 0; diff --git a/crates/noseyparker/Cargo.toml b/crates/noseyparker/Cargo.toml index 505259100..a7640087f 100644 --- a/crates/noseyparker/Cargo.toml +++ b/crates/noseyparker/Cargo.toml @@ -55,7 +55,7 @@ thiserror = "1" tokio = { version = "1.23", optional = true } tracing = "0.1" url = "2.3" -vectorscan-rs = { version = "0.0.4" } +vectorscan-rs = { version = "0.0.5" } [dev-dependencies] pretty_assertions = "1.3"