diff --git a/api/.flake8 b/api/.flake8 index e4e4892..223d36c 100644 --- a/api/.flake8 +++ b/api/.flake8 @@ -1,4 +1,4 @@ [flake8] max-line-length = 80 -select = C,E,F,W,B,B950 -extend-ignore = E203, E501 +extend-select = B950 +extend-ignore = E203,E501 diff --git a/api/.isort.cfg b/api/.isort.cfg new file mode 100644 index 0000000..d056ad0 --- /dev/null +++ b/api/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +profile = black +line_length = 80 diff --git a/api/advent22_api/core/depends.py b/api/advent22_api/core/depends.py index a9423a2..15c90ab 100644 --- a/api/advent22_api/core/depends.py +++ b/api/advent22_api/core/depends.py @@ -24,6 +24,8 @@ from .helpers import ( set_len, ) +RE_NUM = re.compile(r"/(\d+)\.", flags=re.IGNORECASE) + async def get_all_sorted_days( cal_cfg: CalendarConfig = Depends(get_calendar_config), @@ -109,11 +111,10 @@ async def get_all_manual_image_names( Bilder: "manual" zuordnen """ - num_re = re.compile(r"/(\d+)\.", flags=re.IGNORECASE) return { int(num_match.group(1)): name for name in manual_image_names - if (num_match := num_re.search(name)) is not None + if (num_match := RE_NUM.search(name)) is not None }