Skip to content

Commit

Permalink
- F add date pattern to get_scrubber_for
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsanavni committed Dec 11, 2024
1 parent 67f32b8 commit 5b5f4b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions approvaltests/scrubbers/date_scrubber.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def get_supported_formats():
r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s([0-3]?\d)\s([0-1]\d:[0-5]\d:[0-5]\d)\s(\d{4})",
["Tue May 13 16:30:00 2014", "Wed Dec 11 14:59:44 2024"],
),
(
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}",
["2021-09-10T08:07:00+03:00", "2021-01-01T00:00:00+00:00"],
),
]

def __init__(self, date_regex: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
| 2023-07-16 17:39:03.293919 | \d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{2}\:\d{2}\.\d{6} |
| 20210505T091112Z | \d{8}T\d{6}Z |
| Tue May 13 16:30:00 2014 | (Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s([0-3]?\d)\s([0-1]\d:[0-5]\d:[0-5]\d)\s(\d{4}) |
| 2021-09-10T08:07:00+03:00 | \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2} |
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Exception: No match found for 'an unsupported format'.
2023-07-16 17:39:03.293919 | \d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{2}\:\d{2}\.\d{6}
20210505T091112Z | \d{8}T\d{6}Z
Tue May 13 16:30:00 2014 | (Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s([0-3]?\d)\s([0-1]\d:[0-5]\d:[0-5]\d)\s(\d{4})
2021-09-10T08:07:00+03:00 | \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}

0 comments on commit 5b5f4b0

Please sign in to comment.