diff --git a/rendercv/cli/watcher.py b/rendercv/cli/watcher.py index b5196f05..21ce2d0d 100644 --- a/rendercv/cli/watcher.py +++ b/rendercv/cli/watcher.py @@ -20,16 +20,14 @@ class ModifiedCVEventHandler(FileSystemEventHandler): Args: file_path (pathlib.Path): The path of the file to watch for. - function (Callable[..., None]): The function to be called on file modification. - - *CALLBACK MUST BE NON-BLOCKING* + function (Callable): The function to be called on file modification. """ file_path: pathlib.Path function: Callable[..., None] previous_hash: str = "" - def __init__(self, file_path: pathlib.Path, function: Callable[..., None]): + def __init__(self, file_path: pathlib.Path, function: Callable): self.function = function self.file_path = file_path @@ -56,14 +54,13 @@ class ModifiedCVEventHandler(FileSystemEventHandler): def run_a_function_if_a_file_changes( - file_path: pathlib.Path, function: Callable[..., None] + file_path: pathlib.Path, function: Callable ): """Watch file located at `file_path` and trigger callback on file modification. Args: file_path (pathlib.Path): The path of the file to watch for. - function (Callable[..., None]): The function to be called on file modification. - *FUNCTION MUST BE NON-BLOCKING* + function (Callable): The function to be called on file modification. """ event_handler = ModifiedCVEventHandler(file_path, function) observer = Observer() diff --git a/tests/test_cli.py b/tests/test_cli.py index 39a97be1..7976011d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -991,7 +991,7 @@ def test_render_command_with_watch_enabled(cli_command_render, writes, expected_ [ "render", str(new_input_file_path.relative_to(tmp_path)), - f"-w" + "-w" ], )