chore(patterns): add nix-log pattern

This commit is contained in:
technofab 2025-06-11 00:40:20 +02:00
parent 0ea17e1f68
commit b1807d5013
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View file

@ -11,7 +11,7 @@ pub(super) const EXCLUDE_PATTERNS: [(&str, &str); 1] =
///
/// The email address was obtained at https://www.regular-expressions.info/email.html.
/// Some others were obtained from Ferran Basora, the rest is by me.
pub(super) const PATTERNS: [(&str, &str); 22] = [
pub(super) const PATTERNS: [(&str, &str); 23] = [
("markdown-url", r"\[[^]]*\]\(([^)]+)\)"),
(
"url",
@ -49,6 +49,7 @@ pub(super) const PATTERNS: [(&str, &str); 22] = [
r#"(?:--[a-z][0-9a-z\-_]+|-[a-z])(?: |=)([^-\s\n]\S+)"#,
),
("nix-shas", r#"((sha256|sha512)-[a-zA-Z0-9+/=]{44})"#),
("nix-log", r#"(nix log \/nix\/store\/[a-z0-9]{32}-.+?\.drv)"#),
];
/// Type-safe string Pattern Name (newtype).

View file

@ -84,6 +84,8 @@ setup_pattern_binding "P" "--pattern-name pointer-address"
setup_pattern_binding "q" "-x quoted-single -x quoted-double -x quoted-backtick"
# prefix + t + s searches for nix shas
setup_pattern_binding "s" "--pattern-name nix-shas"
# prefix + t + l searches for "nix log .drv"
setup_pattern_binding "l" "--pattern-name nix-log"
# prefix + t + u searches for URLs
setup_pattern_binding "u" "--pattern-name url"
# prefix + t + U searches for UUIDs