Skip to content

Commit 7031243

Browse files
committed
Use insignificant whitespace mode for nice regex
1 parent 502357d commit 7031243

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clippy_dev/src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ use std::fs;
88
use std::io::prelude::*;
99

1010
lazy_static! {
11-
static ref DEC_CLIPPY_LINT_RE: Regex = Regex::new(r#"declare_clippy_lint!\s*[\{(]\s*pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*(?P<cat>[a-z_]+)\s*,\s*"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]"#).unwrap();
12-
static ref DEC_DEPRECATED_LINT_RE: Regex = Regex::new(r#"declare_deprecated_lint!\s*[{(]\s*pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]"#).unwrap();
11+
static ref DEC_CLIPPY_LINT_RE: Regex = Regex::new(r#"(?x)
12+
declare_clippy_lint!\s*[\{(]\s*
13+
pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
14+
(?P<cat>[a-z_]+)\s*,\s*
15+
"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
16+
"#).unwrap();
17+
static ref DEC_DEPRECATED_LINT_RE: Regex = Regex::new(r#"(?x)
18+
declare_deprecated_lint!\s*[{(]\s*
19+
pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
20+
"(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
21+
"#).unwrap();
1322
static ref NL_ESCAPE_RE: Regex = Regex::new(r#"\\\n\s*"#).unwrap();
1423
pub static ref DOCS_LINK: String = "https://rust-lang-nursery.github.io/rust-clippy/master/index.html".to_string();
1524
}

0 commit comments

Comments
 (0)