nf-core / nf-core/tools

Lint for correct publishDir specification in modules.config

Open
#1,286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

linting modules
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

There are various ways you can use the publishDIr directive in the native DSL2 implementation. One can only replace the entire publishDir directive which leads to a lot of repeated code in this config file. Along with checking if one of enabled: false, pattern: "<pattern>", or saveAs: { filename -> filename.equals('versions.yml') ? null : filename } is present (and that needs to account for the nested syntax too), otherwise the versions.yml gets output too.

Not sure how trivial it would be to lint for stuff like this...from what I have seen these directives can be used in loads of different ways so it is going to be a nightmare writing a parser for this. Also, NF configs aren't standard JSON / YAML we can just slurp up. I am not 💯 about having a custom function given that we have removed the need for almost all of them now but we do need to find a way to make these publishDir specifications clearer.

See https://github.com/nf-core/rnaseq/pull/701#discussion_r725701820

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the requested publishDir checks in this issue and the linked nf-core/rnaseq pull-request discussion. Identify how modules.config is currently parsed and how existing lint rules are structured. Done means a lint rule can recognize the described publishDir forms, including nested syntax, and reports configurations that could publish versions.yml unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.