Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nf-core modules lint errors out when there are unexpected labels #1733

Closed
awgymer opened this issue Aug 4, 2022 · 0 comments
Closed

nf-core modules lint errors out when there are unexpected labels #1733

awgymer opened this issue Aug 4, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@awgymer
Copy link
Contributor

awgymer commented Aug 4, 2022

Description of the bug

When running nf-core modules lint on a module which contains a label not starting process_ an AttributeError is raised and the process errors out. It might be better if it was either reported as failing linting or ignored?
i.e.

process MYPROC {
    label 'some_label'
    
    ...
}

As a side not I think that this would also fail if for some reason you had label in your container name - say there was tool called genome_labeller or something - because labels are found by the following which doesn't care where the term appears in the line:

process_label = [l for l in lines if "label" in l]

This could be changed to:

process_label = [l for l in lines if l.lstrip().startswith("label")]

Command used and terminal output

nf-core modules lint <somemodule>

/nf-core-tools/nf_core/modules/lint/main_nf.py:245 in check_process_section 
                                                                                                                
  244 │   if len(process_label) > 0:                                                                            
❱ 245 │   │   process_label = re.search("process_[A-Za-z]+", process_label[0]).group(0)                         
  246 │   │   if not process_label in correct_process_labels:                                                   

AttributeError: 'NoneType' object has no attribute 'group'

System information

nf-core/tools version 2.5.dev0
python 3.9.7
macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants