From 13403823baeb330fe4e55b2841d9e7ec658b51ca Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 11:49:07 +0000 Subject: [PATCH] fix: resolve CI test failures (config access, mocks, imports) --- shellgenius/generation.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shellgenius/generation.py b/shellgenius/generation.py index f3f363b..3674eab 100644 --- a/shellgenius/generation.py +++ b/shellgenius/generation.py @@ -82,7 +82,7 @@ Format your response:""" class ShellParser: """Parser for shell scripts.""" - LINE_PATTERN = re.compile(r"^(?:(\s*)(.*?)(\s*))", re.MULTILINE) + LINE_PATTERN = re.compile(r"^(?:(\s*)(.*?)(\s*))$", re.MULTILINE) COMMENT_PATTERN = re.compile(r"^\s*#") SHEBANG_PATTERN = re.compile(r"^#!(.+)$", re.MULTILINE) @@ -234,7 +234,7 @@ class ShellSafetyChecker: DANGEROUS_PATTERNS = [ (r"rm\s+-rf\s+/", "Removes all files recursively - catastrophic data loss"), - (r":\(\)\s*\{\s*:\s*\|\s*:\s*&\s*;\s*\}", "Fork bomb - can crash system"), + (r":\(\)\s*\{\s*:\s*\|\s*:\s&\s*;\s*\}", "Fork bomb - can crash system"), (r"chmod\s+777", "Removes all file permissions - security risk"), (r"sudo\s+su", "Escalates to root without proper controls"), (r"dd\s+if=/dev/zero", "Can overwrite disks if misconfigured"), @@ -343,7 +343,5 @@ def generate_shell( generator = ShellGenerator() if safety_level: config = get_config() - if "safety" not in config: - config["safety"] = {} - config["safety"]["level"] = safety_level + config.config["safety"]["level"] = safety_level return generator.generate(description, shell_type)