From 6c04e2fee424917ae5a38ac42e01d1db79bb084c Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Wed, 24 Jun 2026 14:10:30 +0200 Subject: [PATCH] feat(cli): add compile option to ignore errors --- midas/cli/commands/compile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/midas/cli/commands/compile.py b/midas/cli/commands/compile.py index 5a623ec..497a0f9 100644 --- a/midas/cli/commands/compile.py +++ b/midas/cli/commands/compile.py @@ -19,9 +19,11 @@ from midas.utils import TypedAST @click.command(help="Compile source") @click.argument("file", type=click.File("r")) @click.option("-t", "--types", type=click.File("r"), multiple=True) +@click.option("--ignore-errors", is_flag=True) def compile( file: TextIO, types: tuple[TextIO], + ignore_errors: bool, ): source: str = file.read() source_path: Path = Path(file.name).resolve() @@ -35,7 +37,9 @@ def compile( printer = DiagnosticPrinter() printer.print_all(diagnostics) - if any(map(lambda d: d.type == DiagnosticType.ERROR, diagnostics)): + if not ignore_errors and any( + map(lambda d: d.type == DiagnosticType.ERROR, diagnostics) + ): sys.exit(1) generator = Generator(workdir=source_path.parent, types=checker.types)