Skip to content

Commit e1dde3c

Browse files
camelidjyn514
authored andcommitted
date-check: Recognize capitalized 'Date' as well
Now, if people use 'Date' instead of 'date', it won't be ignored.
1 parent cf0e151 commit e1dde3c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/date-check/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn make_date_regex() -> Regex {
3939
Regex::new(
4040
r"(?x) # insignificant whitespace mode
4141
<!--\s*
42-
date:\s*
42+
[dD]ate:\s*
4343
(?P<y>\d{4}) # year
4444
-
4545
(?P<m>\d{2}) # month
@@ -186,6 +186,12 @@ mod tests {
186186
assert!(regex.is_match("foo <!-- date: 2021-01 --> bar"));
187187
}
188188

189+
#[test]
190+
fn test_date_regex_capitalized() {
191+
let regex = make_date_regex();
192+
assert!(regex.is_match("foo <!-- Date: 2021-08 --> bar"));
193+
}
194+
189195
#[test]
190196
fn test_collect_dates_from_file() {
191197
let text = "Test1\n<!-- date: 2021-01 -->\nTest2\nFoo<!-- date: 2021-02 \

0 commit comments

Comments
 (0)