tools icon indicating copy to clipboard operation
tools copied to clipboard

nf-core modules lint --fix produces mangled output

Open TCLamnidis opened this issue 1 month ago • 2 comments

Description of the bug

When I use nf-core/modules lint --fix on a module PR, the resulting meta.yml does not successfully lint.

The PR where I encountered the issue: https://github.com/nf-core/modules/pull/9360

The meta.yml at time of writing: https://github.com/nf-core/modules/blob/042a85dfd3a924e299099a22b299b077d7d722a5/modules/nf-core/trident/fetch/meta.yml

Command used and terminal output

The original linting error:


╭─ [✗] 1 Module Test Failed ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                ╷                                        ╷                                                                                                                                                │
│ Module name    │ File path                              │ Test message                                                                                                                                   │
│╶───────────────┼────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴│
│ trident/fetch  │ modules/nf-core/trident/fetch/meta.yml │ correct_meta_outputs: Module meta.yml does not match main.nf. Outputs should contain: {'poseidon_yml': ['output_archive//POSEIDON.yml'],       │
│                │                                        │ 'geno': ['output_archive//.{bed'], 'snp': ['output_archive//.{bim'], 'ind': ['output_archive//.{fam'], 'janno': ['output_archive//.janno'],    │
│                │                                        │ 'ssf': ['output_archive//.ssf'], 'bib': ['output_archive//.bib'], 'changelog': ['output_archive//CHANGELOG.md'], 'readme':                     │
│                │                                        │ ['output_archive/*/README.md'], 'versions': ['versions.yml']} Run nf-core modules lint --fix to update the meta.yml file.                      │
│                ╵                                        ╵                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

The meta.yml created by nf-core modules lint trident/fetch --fix:

[...]
input:
  - - archive_dir:
        type: directory
        description: |
          The path to the directories containing any previously downloaded Poseidon archive files.
          If this is provided, trident fetch will check these directories, and only download missing packages from the Poseidon-Framework server.
    - fetch_s:
        type: string
        description: The fetchString provided to trident fetch (`--fetchString`),
          if any.
    - fetch_fn:
        type: file
        description: A file containing a list of fetchStrings provided to trident
          fetch (`--fetchFile`), if any.
        pattern: "*.txt"

        ontologies: []
output:
  poseidon_yml:
    - output_archive/*/POSEIDON.yml:
        type: file
        description: The POSEIDON.yml file of any newly downloaded package(s).
        pattern: "output_archive/*/POSEIDON.yml"
        ontologies:
          - edam: http://edamontology.org/format_3750 # YAML
  geno:
    - output_archive/*/*.{bed: {}
  snp:
    - output_archive/*/*.{bim: {}
  ind:
    - output_archive/*/*.{fam: {}
  janno:
    - output_archive/*/*.janno:
        type: file
        description: The .janno annotation files of any newly downloaded
          package(s).
        pattern: "output_archive/*/*.janno"
        ontologies: []
  ssf:
    - output_archive/*/*.ssf:
        type: file
        description: The .ssf files of any newly downloaded package(s).
        pattern: "output_archive/*/*.ssf"
        ontologies: []
  bib:
    - output_archive/*/*.bib:
        type: file
        description: The .bib bibliography files of any newly downloaded
          package(s).
        pattern: "output_archive/*/*.bib"
        ontologies: []
  changelog:
    - output_archive/*/CHANGELOG.md:
        type: file
        description: The CHANGELOG.md files of any newly downloaded package(s).
        pattern: "output_archive/*/CHANGELOG.md"
        ontologies: []
  readme:
    - output_archive/*/README.md:
        type: file
        description: The README.md files of any newly downloaded package(s).
        pattern: "output_archive/*/README.md"
        ontologies: []
  versions:
    - versions.yml:
        type: file
        description: File containing software versions
        pattern: "versions.yml"
        ontologies:
          - edam: "http://edamontology.org/format_3750" # YAML
[...]

The output of nf-core modules lint trident/fetch after running with --fix:

╭─ [✗] 1 Module Test Failed ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                ╷                                        ╷                                                                                                                                                │
│ Module name    │ File path                              │ Test message                                                                                                                                   │
│╶───────────────┼────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴│
│ trident/fetch  │ modules/nf-core/trident/fetch/meta.yml │ meta_yml_valid: The meta.yml of the module trident/fetch is not valid: {'output_archive//.{bim': {}} is not valid under any of the given       │
│                │                                        │ schemas. Check the entry for output.                                                                                                           │
│                ╵                                        ╵                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

System information

Nextflow version: 25.04.8 build 5956 Hardware: MacBook Pro OS: macOS 15.4 (24E248) Version of nf-core/tools: 3.4.1 Python version: 3.14.0

TCLamnidis avatar Nov 14 '25 10:11 TCLamnidis

can you try with the current dev version (pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev)? I think I added a fix there for this.

mashehu avatar Nov 14 '25 10:11 mashehu

Sorry for the delay. Tested today with nf-core/tools version 3.6.0.dev0, and the problem persists.

The resulting "fixed" meta looks like this:

  geno:
    - output_archive/*/*.{bed: {}
  snp:
    - output_archive/*/*.{bim: {}
  ind:
    - output_archive/*/*.{fam: {}

TCLamnidis avatar Nov 26 '25 09:11 TCLamnidis