Skip to content

nf-core modules lint --fix produces mangled output #3901

@TCLamnidis

Description

@TCLamnidis

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: nf-core/modules#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions