Skip to content

nextflow lint -exclude misses some cases when absolute paths are reported #6945

@mahesh-panchal

Description

@mahesh-panchal

Bug report

I'm using nextflow lint to check syntax in my repo. What's strange is when I exclude nf-core it sometimes reports absolute paths which include nf-core.

Expected behavior and actual behavior

✨ Pixi task (lint): nextflow lint -exclude .pixi .                                                                                 
Warn  modules/local/dnadotplot/main.nf:20:9: Variable was declared but not used
│  20 |     def prefix = task.ext.prefix ?: "${meta.id}"
╰     |         ^^^^^^

...

Warn  subworkflows/local/prepare_input/main.nf:167:28: Implicit closure parameter is deprecated, declare an explicit parameter instead
│ 167 |     input.hic_ch.filter { !it.isEmpty() }
╰     |                            ^^

...

Error nf-test.config:3:18: Unexpected input: ':'
│   3 |         "nf-test": "0.9.0"
╰     |                  ^

Nextflow linting complete!
 ❌ 2 files had 2 errors
 ✅ 137 files had no errors

In this version it reports only relative paths. But when I add exclude nf-core:

✨ Pixi task (lint): nextflow lint -exclude .pixi -exclude nf-core .                                                                
Warn  modules/local/dnadotplot/main.nf:20:9: Variable was declared but not used
│  20 |     def prefix = task.ext.prefix ?: "${meta.id}"
╰     |         ^^^^^^

...

Warn  modules/local/functions.nf:84:42: Implicit closure parameter is deprecated, declare an explicit parameter instead
│  84 |             .join( join_args, rhs.map{ [ it[0].subMap(args.keySet) ] +
╰     |                                          ^^

...

Warn  /Users/mahpa906/Documents/Projects/Earth-Biogenome-Project-pilot/modules/nf-core/tabix/tabix/main.nf:33:9: Variable was declared but not used
│  33 |     def prefix = task.ext.prefix ?: "${meta.id}"
╰     |         ^^^^^^

Warn  /Users/mahpa906/Documents/Projects/Earth-Biogenome-Project-pilot/modules/nf-core/tidk/plot/main.nf:37:9: Variable was declared but not used
│  37 |     def args = task.ext.args ?: ''
╰     |         ^^^^

...

Error nf-test.config:3:18: Unexpected input: ':'
│   3 |         "nf-test": "0.9.0"
╰     |                  ^

Nextflow linting complete!
 ❌ 2 files had 2 errors
 ✅ 106 files had no errors

The paths are now a mix of relative and absolute, and still includes some with nf-core in them.

Steps to reproduce the problem

git clone https://github.com/NBISweden/Earth-Biogenome-Project-pilot.git
cd Earth-Biogenome-Project-pilot
nextflow run lint -exclude .pixi -exclude nf-core .

Program output

It's included above to show actual output.

Environment

  • Nextflow version: 25.10.4
  • Java version: openjdk 17.0.11 2024-04-16 LTS
  • Operating system: macOS
  • Bash version: zsh 5.9 (arm64-apple-darwin25.0)

Additional context

I wonder if this has anything to do with the - in nf-core. I tested by replacing nf-core with local and it still printed out absolute paths with local in them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions