chore: fix pyright errors to make pipeline green
This commit is contained in:
parent
73268a8039
commit
eaf7fe9b2a
8 changed files with 15 additions and 15 deletions
|
|
@ -1,10 +1,9 @@
|
|||
from datetime import datetime
|
||||
import re
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def extract_date_from_file_name(file_name: str) -> Optional[datetime]:
|
||||
def extract_date_from_file_name(file_name: str) -> datetime | None:
|
||||
FILE_NAME_REGEX = r"^(?P<date>\d{8})(?:-(?P<time>\d{4,6}))?.+.md$"
|
||||
base_name = os.path.basename(file_name)
|
||||
match = re.match(FILE_NAME_REGEX, base_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue