chore: address linting,typing, and documentation concerns

This commit is contained in:
Criyl
2024-10-02 14:39:55 +00:00
committed by Sina Atalay
parent 3858b27de4
commit f16f79afaa
2 changed files with 5 additions and 8 deletions

View File

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

View File

@@ -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"
],
)