diff --git a/ci/date-check/src/main.rs b/ci/date-check/src/main.rs index 2a9da89e..273e07a6 100644 --- a/ci/date-check/src/main.rs +++ b/ci/date-check/src/main.rs @@ -38,8 +38,8 @@ impl fmt::Display for Date { fn make_date_regex() -> Vec { let patterns = [ - r"", - r"\s+(\w+)\s+(\d+{4})", + r"", + r"\s+(\D+)\s+(\d{4})\b", ]; let set = RegexSet::new(&patterns).unwrap(); set.patterns() @@ -198,6 +198,20 @@ mod tests { assert!(regexes[1].is_match(" january 2021")); assert!(regexes[1].is_match(" Jan 2021")); assert!(regexes[1].is_match(" January 2021")); + + assert!(regexes[1].is_match(" jan 2021 ")); + assert!(regexes[1].is_match(" jan 2021.")); + } + + #[test] + fn test_date_regex_fail() { + let regexes = &make_date_regex(); + assert!(!regexes[0].is_match("")); + assert!(!regexes[0].is_match("")); + assert!(!regexes[0].is_match("")); + assert!(!regexes[1].is_match(" jan 221")); + assert!(!regexes[1].is_match(" jan 20222")); + assert!(!regexes[1].is_match(" 01 2021")); } #[test] diff --git a/src/building/suggested.md b/src/building/suggested.md index 1c222933..3e077977 100644 --- a/src/building/suggested.md +++ b/src/building/suggested.md @@ -22,7 +22,7 @@ You can also install the hook as a step of running `./x.py setup`! a file. By default, `rust-analyzer` runs the `cargo check` and `rustfmt` commands, but you can override these commands to use more adapted versions of these tools when hacking on `rustc`. For example, for Visual Studio Code, -you can write: +you can write: ```JSON { diff --git a/src/contributing.md b/src/contributing.md index 6c445763..2a337c80 100644 --- a/src/contributing.md +++ b/src/contributing.md @@ -447,9 +447,10 @@ Just a few things to keep in mind: There is a CI action (in "~/.github/workflows/date-check.yml") that generates a monthly issue with any of these that are over 6 months old. - For the action to pick the date, add this annotation: + For the action to pick the date, + add a special annotation before specifying the date: - + Jul 2022 Example: