From 7fec47f9b9f8ddb9a18ff442350bdee80140db92 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 13 Nov 2026 23:01:57 +0100 Subject: [PATCH] Kill the mutant that reads any word recurse after an option as recursion --- bin/rule_hook/test_rule_hook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/rule_hook/test_rule_hook.py b/bin/rule_hook/test_rule_hook.py index f4e65476..fde47dc0 100644 --- a/bin/rule_hook/test_rule_hook.py +++ b/bin/rule_hook/test_rule_hook.py @@ -494,6 +494,10 @@ class EnvFileRead(unittest.TestCase): with self.subTest(command): self.assertEqual(self.breached("Bash", {"command": command}), []) self.assertEqual(self.breached("Bash", {"command": "rg TOKEN"}, f"{self.home}/code"), []) + # The word recurse is only a pattern or a file name here, and -d read is no recursion. + for command in ("grep -n recurse notes.md", "grep -d read TOKEN ~/secrets", "grep --directories read TOKEN ~/secrets"): + with self.subTest(command): + self.assertEqual(self.breached("Bash", {"command": command}, str(self.home)), []) # secrets is the pattern, not the folder ~/secrets that the home directory holds. self.assertEqual(self.breached("Bash", {"command": "rg secrets ~/code"}, str(self.home)), [])