Fix CI issues: add Config class, fix config access patterns, remove unused imports
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -343,5 +343,7 @@ def generate_shell(
|
||||
generator = ShellGenerator()
|
||||
if safety_level:
|
||||
config = get_config()
|
||||
config.config["safety"]["level"] = safety_level
|
||||
if "safety" not in config:
|
||||
config["safety"] = {}
|
||||
config["safety"]["level"] = safety_level
|
||||
return generator.generate(description, shell_type)
|
||||
|
||||
Reference in New Issue
Block a user