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

Linting exits with error Indexerror #1321

Closed
DSchreyer opened this issue Nov 16, 2021 · 2 comments · Fixed by #1439
Closed

Linting exits with error Indexerror #1321

DSchreyer opened this issue Nov 16, 2021 · 2 comments · Fixed by #1439
Labels
bug Something isn't working high-priority linting
Milestone

Comments

@DSchreyer
Copy link

DSchreyer commented Nov 16, 2021

Description of the bug

I used nf-core lint on my pipeline which was written using the nf-core template. At first, linting worked as expected and I could fix some of the issues in the pipeline. However, I currently receive a linting error, which seems unhandled.

At first I thought that it is coming from my computer, but pulling the github repository on another machine creates the same error.

Steps to reproduce

Steps to reproduce the behaviour:

  1. Command line:
    git clone git@github.com:DSchreyer/circdna.git
    nf-core lint

  2. See error:

$ 02:33:21 BICR\dschreye@r01-srv01-l-s nf-core-circleseq ±|main ✗|→ nf-core lint

                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 2.1



INFO     Testing pipeline: .                                                                                                                                                                                                   __init__.py:240
Running lint checks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10 of 16 » template_strings
╭───────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────╮
│ /home/local/BICR/dschreye/miniconda3/bin/nf-core:10 in <module>                                                                                                                                      │
│                                                                                                                                                                                                      │
│    9 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                                                                                                                            │
│ ❱ 10 │   sys.exit(run_nf_core())                                                                                                                                                                     │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/__main__.py:62 in run_nf_core                                                                                               │
│                                                                                                                                                                                                      │
│    61 │   # Lanch the click cli                                                                                                                                                                      │
│ ❱  62 │   nf_core_cli()                                                                                                                                                                              │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/click/core.py:829 in __call__                                                                                                       │
│                                                                                                                                                                                                      │
│    828 │   │   """Alias for :meth:`main`."""                                                                                                                                                         │
│ ❱  829 │   │   return self.main(*args, **kwargs)                                                                                                                                                     │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/click/core.py:782 in main                                                                                                           │
│                                                                                                                                                                                                      │
│    781 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                                                                                                                      │
│ ❱  782 │   │   │   │   │   rv = self.invoke(ctx)                                                                                                                                                     │
│    783 │   │   │   │   │   if not standalone_mode:                                                                                                                                                   │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/click/core.py:1259 in invoke                                                                                                        │
│                                                                                                                                                                                                      │
│   1258 │   │   │   │   with sub_ctx:                                                                                                                                                                 │
│ ❱ 1259 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                   │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/click/core.py:1066 in invoke                                                                                                        │
│                                                                                                                                                                                                      │
│   1065 │   │   if self.callback is not None:                                                                                                                                                         │
│ ❱ 1066 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                                                                                                                    │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/click/core.py:610 in invoke                                                                                                         │
│                                                                                                                                                                                                      │
│    609 │   │   │   with ctx:                                                                                                                                                                         │
│ ❱  610 │   │   │   │   return callback(*args, **kwargs)                                                                                                                                              │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/__main__.py:336 in lint                                                                                                     │
│                                                                                                                                                                                                      │
│   335 │   try:                                                                                                                                                                                       │
│ ❱ 336 │   │   lint_obj, module_lint_obj = nf_core.lint.run_linting(                                                                                                                                  │
│   337 │   │   │   dir, release, fix, key, show_passed, fail_ignored, markdown, json                                                                                                                  │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/lint/__init__.py:99 in run_linting                                                                                          │
│                                                                                                                                                                                                      │
│    98 │   if len(module_lint_obj.all_local_modules) > 0:                                                                                                                                             │
│ ❱  99 │   │   module_lint_obj.lint_modules(module_lint_obj.all_local_modules, local=True)                                                                                                            │
│   100 │   if len(module_lint_obj.all_nfcore_modules) > 0:                                                                                                                                            │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/modules/lint/__init__.py:300 in lint_modules                                                                                │
│                                                                                                                                                                                                      │
│   299 │   │   │   │   progress_bar.update(lint_progress, advance=1, test_name=mod.module_name)                                                                                                       │
│ ❱ 300 │   │   │   │   self.lint_module(mod, local=local)                                                                                                                                             │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/modules/lint/__init__.py:322 in lint_module                                                                                 │
│                                                                                                                                                                                                      │
│   321 │   │   if local:                                                                                                                                                                              │
│ ❱ 322 │   │   │   self.main_nf(mod)                                                                                                                                                                  │
│   323 │   │   │   self.passed += [LintResult(mod, *m) for m in mod.passed]                                                                                                                           │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/modules/lint/main_nf.py:61 in main_nf                                                                                       │
│                                                                                                                                                                                                      │
│    60 │   │   if state == "output" and not _is_empty(module, l):                                                                                                                                     │
│ ❱  61 │   │   │   outputs += _parse_output(module, l)                                                                                                                                                │
│    62 │   │   │   outputs = list(set(outputs))  # remove duplicate 'meta's                                                                                                                           │
│                                                                                                                                                                                                      │
│ /home/local/BICR/dschreye/miniconda3/lib/python3.8/site-packages/nf_core/modules/lint/main_nf.py:244 in _parse_output                                                                                │
│                                                                                                                                                                                                      │
│   243 │   if "emit" in line:                                                                                                                                                                         │
│ ❱ 244 │   │   output.append(line.split("emit:")[1].strip())                                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

Expected behaviour

Generally, linting should give me a list of errors or warnings regarding the pipeline setup.

System

  • Hardware: HPC
  • OS: Ubuntu 20.4
  • Version of nf-core/tools: 2.1
  • Python version: 3.8.3

Nextflow Installation

  • Version: 21.04.0

Additional context

@DSchreyer DSchreyer added the bug Something isn't working label Nov 16, 2021
@ewels ewels added this to the 2.3 milestone Dec 9, 2021
@ewels ewels changed the title Linting exits with error "Indexerror: list index out of range" Linting exits with error Indexerror Dec 9, 2021
@ewels ewels added the linting label Dec 9, 2021
@drpatelh drpatelh modified the milestones: 2.4, 2.3 Mar 8, 2022
@ewels
Copy link
Member

ewels commented Mar 14, 2022

Note to self, attempting to reproduce error with the same state of the repo, guessing at around https://github.com/nf-core/circdna/tree/1e9fe9463486d9fa021c7dfa2d8907257fd5f6ac based on the timestamps of commits / the issue

ewels added a commit to ewels/nf-core-tools that referenced this issue Mar 14, 2022
@ewels
Copy link
Member

ewels commented Mar 14, 2022

I'm not able to replicate the error, however I've looked at the source code and done a minor refactor which should hopefully avoid this edge case: #1439

@ewels ewels linked a pull request Mar 14, 2022 that will close this issue
4 tasks
@ewels ewels closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority linting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants