Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP: more type hints
  • Loading branch information
ZetaTwo committed Jan 11, 2024
commit 3f361dbf32bc52e6b155f76b4682818e7d9fcfaa
9 changes: 5 additions & 4 deletions challtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ def get_valid_config(workdir: Optional[Union[str, Path]] = None, search: bool =
Raises:
CriticalException: If there are critical validation errors
"""
config = load_config(
search=search, cd=cd, **{"workdir": workdir} if workdir else {}
)
if workdir:
config = load_config(search=search, cd=cd, workdir=workdir)
else:
config = load_config(search=search, cd=cd)

validator = ConfigValidator(config)
messages = validator.validate()[1]
Expand Down Expand Up @@ -223,7 +224,7 @@ def get_valid_config(workdir: Optional[Union[str, Path]] = None, search: bool =
return validator.normalized_config


def discover_challenges(search_start: Optional[bool] = None) -> List[Path]:
def discover_challenges(search_start: Optional[str] = None) -> Optional[List[Path]]:
"""Discovers all challenges at the same level as or in a subdirectory below the CTF configuration file.

Returns:
Expand Down