From 7d6d64925be88abc987662ce80793934ec9cea7f Mon Sep 17 00:00:00 2001 From: Till Hartmann Date: Mon, 25 Nov 2024 11:01:30 +0100 Subject: [PATCH] fix: extra args check (#551) --- snappy_pipeline/workflows/somatic_variant_calling/model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snappy_pipeline/workflows/somatic_variant_calling/model.py b/snappy_pipeline/workflows/somatic_variant_calling/model.py index 5e017785a..bf74db895 100644 --- a/snappy_pipeline/workflows/somatic_variant_calling/model.py +++ b/snappy_pipeline/workflows/somatic_variant_calling/model.py @@ -87,10 +87,8 @@ def argument(args: list[str]) -> list[str]: def _is_valid_argument(arg: str) -> bool: return arg.startswith("--") - if any(_is_valid_argument(arg) for arg in args): - raise ValueError( - f"invalid arguments: {list(filter(lambda x: not _is_valid_argument(x), args))}" - ) + if invalid_args := list(filter(lambda x: not _is_valid_argument(x), args)): + raise ValueError(f"invalid arguments: {invalid_args}") return args