Skip to content

Commit

Permalink
allow labels between single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Apr 28, 2023
1 parent 1879ff5 commit 95d7ef3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
Expand Down
18 changes: 9 additions & 9 deletions tests/modules/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self):

PROCESS_LABEL_GOOD = (
"""
label process_high
label 'process_high'
cpus 12
""",
1,
Expand All @@ -131,7 +131,7 @@ def __init__(self):
)
PROCESS_LABEL_NON_ALPHANUMERIC = (
"""
label a:label:with:colons
label 'a:label:with:colons'
cpus 12
""",
0,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -170,7 +170,7 @@ def __init__(self):
)
PROCESS_LABEL_NONSTANDARD = (
"""
label process_extra_label
label 'process_extra_label'
cpus 12
""",
0,
Expand Down

0 comments on commit 95d7ef3

Please sign in to comment.