From 5312738d5023f79b78fc5d7ffc018e9d7418c8fb Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 29 Jan 2026 23:16:25 -0800 Subject: [PATCH] feat: add default app and manifest watch config --- slack_cli_hooks/hooks/get_hooks.py | 10 +++++++++- tests/slack_cli_hooks/hooks/test_get_hooks.py | 15 +++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/slack_cli_hooks/hooks/get_hooks.py b/slack_cli_hooks/hooks/get_hooks.py index 5b28f61..7399961 100644 --- a/slack_cli_hooks/hooks/get_hooks.py +++ b/slack_cli_hooks/hooks/get_hooks.py @@ -18,9 +18,17 @@ "doctor": f"{EXEC} -m slack_cli_hooks.hooks.doctor", }, "config": { - "watch": {"filter-regex": "(^manifest\\.json$)", "paths": ["."]}, "protocol-version": [MessageBoundaryProtocol.name, DefaultProtocol.name], "sdk-managed-connection-enabled": True, + "watch": { + "app": { + "filter-regex": "\\.py$", + "paths": ["."], + }, + "manifest": { + "paths": ["manifest.json"], + }, + }, }, "runtime": "python", } diff --git a/tests/slack_cli_hooks/hooks/test_get_hooks.py b/tests/slack_cli_hooks/hooks/test_get_hooks.py index 0dc7426..6b5ed86 100644 --- a/tests/slack_cli_hooks/hooks/test_get_hooks.py +++ b/tests/slack_cli_hooks/hooks/test_get_hooks.py @@ -1,5 +1,3 @@ -import re - from slack_cli_hooks.hooks.get_hooks import hooks_payload @@ -18,13 +16,18 @@ def test_hooks_payload_config(self): assert config["sdk-managed-connection-enabled"] is True assert config["protocol-version"] == ["message-boundaries", "default"] - def test_hooks_watch_regex(self): + def test_hooks_watch_app(self): config = hooks_payload["config"] - assert config["watch"] is not None + assert config["watch"]["app"] is not None + assert config["watch"]["app"]["filter-regex"] == "\\.py$" + assert config["watch"]["app"]["paths"] == ["."] - filter_regex = config["watch"]["filter-regex"] - assert re.match(filter_regex, "manifest.json") is not None + def test_hooks_watch_manifest(self): + config = hooks_payload["config"] + assert config["watch"] is not None + assert config["watch"]["manifest"] is not None + assert config["watch"]["manifest"]["paths"] == ["manifest.json"] def test_hooks_runtime(self): runtime = hooks_payload["runtime"]