From 95d7ef37b73b1541d5beec5fd8112fcb73a5bcf7 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Fri, 28 Apr 2023 10:24:20 +0200 Subject: [PATCH] allow labels between single quotes --- nf_core/modules/lint/main_nf.py | 2 +- tests/modules/lint.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index e5aaa9e0c4..bacc7d7fbd 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -403,7 +403,7 @@ def check_process_labels(self, lines): if len(all_labels) > 0: for label in all_labels: try: - label = re.match("^label\s+([a-zA-Z0-9_-]+)$", label).group(1) + label = re.match(r"^label\s+'?([a-zA-Z0-9_-]+)'?$", label).group(1) except AttributeError: self.warned.append( ( diff --git a/tests/modules/lint.py b/tests/modules/lint.py index 90697fbf90..b7aaf610ca 100644 --- a/tests/modules/lint.py +++ b/tests/modules/lint.py @@ -122,7 +122,7 @@ def __init__(self): PROCESS_LABEL_GOOD = ( """ - label process_high + label 'process_high' cpus 12 """, 1, @@ -131,7 +131,7 @@ def __init__(self): ) PROCESS_LABEL_NON_ALPHANUMERIC = ( """ - label a:label:with:colons + label 'a:label:with:colons' cpus 12 """, 0, @@ -140,8 +140,8 @@ def __init__(self): ) PROCESS_LABEL_GOOD_CONFLICTING = ( """ - label process_high - label process_low + label 'process_high' + label 'process_low' cpus 12 """, 0, @@ -150,8 +150,8 @@ def __init__(self): ) PROCESS_LABEL_GOOD_DUPLICATES = ( """ - label process_high - label process_high + label 'process_high' + label 'process_high' cpus 12 """, 0, @@ -160,8 +160,8 @@ def __init__(self): ) PROCESS_LABEL_GOOD_AND_NONSTANDARD = ( """ - label process_high - label process_extra_label + label 'process_high' + label 'process_extra_label' cpus 12 """, 1, @@ -170,7 +170,7 @@ def __init__(self): ) PROCESS_LABEL_NONSTANDARD = ( """ - label process_extra_label + label 'process_extra_label' cpus 12 """, 0,