Skip to content

Commit

Permalink
Upgrade vectorscan from v0.0.4 to v0.0.5; add additional `rules check…
Browse files Browse the repository at this point in the history
…` debug output
  • Loading branch information
bradlarsen committed Dec 9, 2024
1 parent fb766d9 commit 3e2a837
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/noseyparker-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
7 changes: 5 additions & 2 deletions crates/noseyparker-cli/src/cmd_rules/cmd_rules_check.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -269,12 +269,15 @@ fn check_rule(rule: &Rule, args: &RulesCheckArgs) -> Result<CheckStats> {
}
};

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;
Expand Down
2 changes: 1 addition & 1 deletion crates/noseyparker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3e2a837

Please sign in to comment.