From 161ebd88a0ad35f056697fabe5ba2d65bb537397 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 00:19:40 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tux/utils/functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tux/utils/functions.py b/tux/utils/functions.py index 4c6a65c..944ba5d 100644 --- a/tux/utils/functions.py +++ b/tux/utils/functions.py @@ -14,9 +14,12 @@ harmful_command_pattern = ( r"|format\s+([A-Z]:|C:|D:|E:|F:|G:|H:|I:|J:|K:|L:|M:|N:|O:|P:|Q:|R:|S:|T:|U:|V:|W:|X:|Y:|Z:)" ) + def is_harmful(command: str) -> bool: first_test: bool = re.search(harmful_command_pattern, command) is not None - second_test: bool = re.search(r"rm.{0,5}[rfRF]", command) is not None or re.search(r"del\s+/[qsf]", command) is not None + second_test: bool = ( + re.search(r"rm.{0,5}[rfRF]", command) is not None or re.search(r"del\s+/[qsf]", command) is not None + ) return first_test and second_test