I'm reporting this as a bug since after https://github.com/rust-lang/regex/issues/607 I believed that I was able to use unwrap/expect unchecked with regex creation since I've got clippy configured to check my project. Later I realized I need multiple different regex crates. I think if someone comes across that issue and sees that Regex::new() is checked, they might not realize or remember they're using an unsupported crate.
Lint Name
invalid_regex
Reproducer
I tried this code:
let _foo = fancy_regex::Regex::new("(").unwrap();
I expected to see this happen:
error: regex syntax error: unclosed group
--> commons/src/gem_version.rs:198:39
|
198 | let _foo = fancy_regex::Regex::new("(").unwrap();
Instead, this happened:
$ cargo clippy --all-targets
Blocking waiting for file lock on build directory
Checking commons v0.1.0 (/Users/rschneeman/Documents/projects/work/buildpacks/buildpacks-ruby/commons)
Finished dev [unoptimized + debuginfo] target(s) in 0.93s
Summary
Hello and thank you for this amazing project!
I see that this Regex lint https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex will only check a Regex from the
regex
crate. I would like the ability to lint Regex creation in other crates, specificallyfancy_regex
.I'm reporting this as a bug since after https://github.com/rust-lang/regex/issues/607 I believed that I was able to use unwrap/expect unchecked with regex creation since I've got clippy configured to check my project. Later I realized I need multiple different regex crates. I think if someone comes across that issue and sees that
Regex::new()
is checked, they might not realize or remember they're using an unsupported crate.Lint Name
invalid_regex
Reproducer
I tried this code:
I expected to see this happen:
Instead, this happened:
Version