chore: fix pyright errors to make pipeline green

This commit is contained in:
Konstantin Fickel 2025-10-12 08:30:10 +02:00
parent 73268a8039
commit eaf7fe9b2a
Signed by: kfickel
GPG key ID: A793722F9933C1A5
8 changed files with 15 additions and 15 deletions

View file

@ -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)