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:
|
class ShellParser:
|
||||||
"""Parser for shell scripts."""
|
"""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*#")
|
COMMENT_PATTERN = re.compile(r"^\s*#")
|
||||||
SHEBANG_PATTERN = re.compile(r"^#!(.+)$", re.MULTILINE)
|
SHEBANG_PATTERN = re.compile(r"^#!(.+)$", re.MULTILINE)
|
||||||
|
|
||||||
@@ -343,5 +343,7 @@ def generate_shell(
|
|||||||
generator = ShellGenerator()
|
generator = ShellGenerator()
|
||||||
if safety_level:
|
if safety_level:
|
||||||
config = get_config()
|
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)
|
return generator.generate(description, shell_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user