internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: nf-core/tools

Issue:
nf-code modules lint failing when all modules up to date
nf-code modules lint failing when all modules up to date

This is due to a failed messages that is not turned into a `LintResult` object


Discussion:

Resolving patch:
diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py
--- a/nf_core/modules/lint.py
+++ b/nf_core/modules/lint.py
@@ -375,7 +375,6 @@ def check_module_changes(self, nfcore_modules):
         Downloads the 'main.nf', 'functions.nf' and 'meta.yml' files for every module
         and compare them to the local copies
         """
-        all_modules_up_to_date = True
         files_to_check = ["main.nf", "functions.nf", "meta.yml"]
 
         progress_bar = rich.progress.Progress(
@@ -420,7 +419,6 @@ def check_module_changes(self, nfcore_modules):
                             remote_copy = r.content.decode("utf-8")
 
                             if local_copy != remote_copy:
-                                all_modules_up_to_date = False
                                 self.warned.append(
                                     LintResult(
                                         mod,
@@ -429,6 +427,15 @@ def check_module_changes(self, nfcore_modules):
                                         f"{os.path.join(mod.module_dir, f)}",
                                     )
                                 )
+                            else:
+                                self.passed.append(
+                                    LintResult(
+                                        mod,
+                                        "check_local_copy",
+                                        "Local copy of module up to date",
+                                        f"{os.path.join(mod.module_dir, f)}",
+                                    )
+                                )
                         except UnicodeDecodeError as e:
                             self.warned.append(
                                 LintResult(
@@ -439,9 +446,6 @@ def check_module_changes(self, nfcore_modules):
                                 )
                             )
 
-        if all_modules_up_to_date:
-            self.passed.append("All modules are up to date!")
-
 
 class NFCoreModule(object):
     """


Test patch:
diff --git a/tests/test_modules.py b/tests/test_modules.py
--- a/tests/test_modules.py
+++ b/tests/test_modules.py
@@ -83,7 +83,7 @@ def test_modules_lint_fastqc(self):
         self.mods.install("fastqc")
         module_lint = nf_core.modules.ModuleLint(dir=self.pipeline_dir)
         module_lint.lint(print_results=False, all_modules=True)
-        assert len(module_lint.passed) == 16
+        assert len(module_lint.passed) == 18
         assert len(module_lint.warned) == 0
         assert len(module_lint.failed) == 0
Repository: nf-core/tools

Issue:
nf-core modules create creates wrong process label when subtool is given
When using `nf-core modules create tool/subtool`, the `main.nf`  file will have a process name called `TOOL/SUBTOOL`  which should be `TOOL_SUBTOOL`. 

The reason for that is that we don't set the `self.subtool`  variable anymore (it's always `None`).
So to solve this we should just check, in the init function of the `ModuleCreate` class, whether the tool has a subtool and then set `self.subtool` to true/false accordingly.


Discussion:

Resolving patch:
diff --git a/nf_core/modules/create.py b/nf_core/modules/create.py
--- a/nf_core/modules/create.py
+++ b/nf_core/modules/create.py
@@ -33,9 +33,8 @@ def __init__(
         self.process_label = process_label
         self.has_meta = has_meta
         self.force_overwrite = force
-
-        self.tool_conda_name = conda_name
         self.subtool = None
+        self.tool_conda_name = conda_name
         self.tool_licence = None
         self.repo_type = None
         self.tool_licence = ""
@@ -116,6 +115,8 @@ def create(self):
             self.tool_name = f"{self.tool}/{self.subtool}"
             self.tool_dir = os.path.join(self.tool, self.subtool)
 
+        self.tool_name_underscore = self.tool_name.replace("/", "_")
+
         # Check existance of directories early for fast-fail
         self.file_paths = self.get_module_dirs()
 


Test patch:
diff --git a/nf_core/module-template/tests/main.nf b/nf_core/module-template/tests/main.nf
--- a/nf_core/module-template/tests/main.nf
+++ b/nf_core/module-template/tests/main.nf
@@ -2,9 +2,9 @@
 
 nextflow.enable.dsl = 2
 
-include { {{ tool_name|upper }} } from '../../../{{ "../" if subtool else "" }}software/{{ tool_dir }}/main.nf' addParams( options: [:] )
+include { {{ tool_name_underscore|upper }} } from '../../../{{ "../" if subtool else "" }}software/{{ tool_dir }}/main.nf' addParams( options: [:] )
 
-workflow test_{{ tool_name }} {
+workflow test_{{ tool_name_underscore }} {
     {% if has_meta %}
     input = [ [ id:'test', single_end:false ], // meta map
               file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ]
@@ -12,5 +12,5 @@ workflow test_{{ tool_name }} {
     input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
     {%- endif %}
 
-    {{ tool_name|upper }} ( input )
+    {{ tool_name_underscore|upper }} ( input )
 }
diff --git a/nf_core/module-template/tests/test.yml b/nf_core/module-template/tests/test.yml
--- a/nf_core/module-template/tests/test.yml
+++ b/nf_core/module-template/tests/test.yml
@@ -1,7 +1,7 @@
 ## TODO nf-core: Please run the following command to build this file:
 #                nf-core modules create-test-yml {{ tool }}{%- if subtool %}/{{ subtool }}{%- endif %}
 - name: {{ tool }}{{ ' '+subtool if subtool else '' }}
-  command: nextflow run ./tests/software/{{ tool_dir }} -entry test_{{ tool_name }} -c tests/config/nextflow.config
+  command: nextflow run ./tests/software/{{ tool_dir }} -entry test_{{ tool_name_underscore }} -c tests/config/nextflow.config
   tags:
     - {{ tool }}
     {%- if subtool %}
Repository: nf-core/tools

Issue:
Show ignore modules in `nf-core modules bump-versions`
Modules ignore via the `.nf-core.yml` are currently not shown at all when running the `nf-core modules bump-versions` command. 

## Describe the solution you'd like

Add a new `Module ignored` section to `nf-core modules bump-versions` table with modules ignored via the `.nf-core.yml`. 

## Describe alternatives you've considered

Issue a log messages about which modules have been ignored. 



Discussion:

Resolving patch:
diff --git a/nf_core/modules/bump_versions.py b/nf_core/modules/bump_versions.py
--- a/nf_core/modules/bump_versions.py
+++ b/nf_core/modules/bump_versions.py
@@ -50,6 +50,7 @@ def bump_versions(self, module=None, all_modules=False, show_uptodate=False):
         self.up_to_date = []
         self.updated = []
         self.failed = []
+        self.ignored = []
         self.show_up_to_date = show_uptodate
 
         # Verify that this is not a pipeline
@@ -130,7 +131,7 @@ def bump_module_version(self, module: NFCoreModule):
         if module.module_name in self.bump_versions_config:
             config_version = self.bump_versions_config[module.module_name]
             if not config_version:
-                self.up_to_date.append((f"Omitting module due to config: {module.module_name}", module.module_name))
+                self.ignored.append((f"Omitting module due to config.", module.module_name))
                 return False
 
         # check for correct version and newer versions
@@ -331,3 +332,16 @@ def format_result(module_updates, table):
             table.add_column("Update message")
             table = format_result(self.failed, table)
             console.print(table)
+
+        # Table of modules ignored due to `.nf-core.yml`
+        if len(self.ignored) > 0:
+            console.print(
+                rich.panel.Panel(
+                    r"[!] {} Module update{} ignored".format(len(self.ignored), _s(self.ignored)), style="grey58"
+                )
+            )
+            table = Table(style="grey58", box=rich.box.ROUNDED)
+            table.add_column("Module name", width=max_mod_name_len)
+            table.add_column("Update message")
+            table = format_result(self.ignored, table)
+            console.print(table)


Test patch:
Repository: nf-core/tools

Issue:
Linting does not recognize README Nextflow minimum version mention in Quick Start
When running `nf-core lint` with a readme file that has the following in it:

```
## Quick Start

1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=21.04.0`)
```

A warning is triggered:

```
readme: README did not have a Nextflow minimum version mentioned in Quick Start section.
```

This warning should not be triggering as the minimum nextflow version is in the readme file.

Link to code location

https://github.com/nf-core/tools/blob/01291016652284bfba23a900399fa0155906a7c5/nf_core/lint/readme.py#L65-L66



Discussion:

Resolving patch:
diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -62,8 +62,8 @@ def readme(self):
         warned.append("README did not have a Nextflow minimum version badge.")
 
     # Check that the minimum version mentioned in the quick start section is consistent
-    # Looking for: "1. Install [`Nextflow`](https://nf-co.re/usage/installation) (`>=21.04.0`)"
-    nf_version_re = r"1\.\s*Install\s*\[`Nextflow`\]\(https://nf-co.re/usage/installation\)\s*\(`>=(\d*\.\d*\.\d*)`\)"
+    # Looking for: "1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=21.04.0`)"
+    nf_version_re = r"1\.\s*Install\s*\[`Nextflow`\]\(https://www.nextflow.io/docs/latest/getstarted.html#installation\)\s*\(`>=(\d*\.\d*\.\d*)`\)"
     match = re.search(nf_version_re, content)
     if match:
         nf_quickstart_version = match.group(1)


Test patch:
Repository: nf-core/tools

Issue:
Non-updated lint tip message
## Description of the bug

Linting with files applicable for auto-fixing gives the following message:

```
Tip: Some of these linting errors can automatically be resolved with the following command:

    nf-core lint . --fix files_unchanged
```

However the `.` declaration has been removed in the latest version of nf-core tools, and so the command errors

```
Error: Got unexpected extra argument (.)
```

## Steps to reproduce

Modify a template file (e.g. `.github/CONTRIBUTING.md`, and run lint command

## Expected behaviour

Update message to remove `.`

## System

- nf-core tools version: 2.1

## Additional context

<!-- Add any other context about the problem here. -->



Discussion:

Resolving patch:
diff --git a/nf_core/lint_utils.py b/nf_core/lint_utils.py
--- a/nf_core/lint_utils.py
+++ b/nf_core/lint_utils.py
@@ -38,7 +38,9 @@ def print_fixes(lint_obj, module_lint_obj):
     """Prints available and applied fixes"""
 
     if len(lint_obj.could_fix):
-        fix_cmd = "nf-core lint {} --fix {}".format(lint_obj.wf_path, " --fix ".join(lint_obj.could_fix))
+        fix_cmd = "nf-core lint {}--fix {}".format(
+            "" if lint_obj.wf_path == "." else f"--dir {lint_obj.wf_path}", " --fix ".join(lint_obj.could_fix)
+        )
         console.print(
             f"\nTip: Some of these linting errors can automatically be resolved with the following command:\n\n[blue]    {fix_cmd}\n"
         )


Test patch:
Repository: nf-core/tools

Issue:
update modules in pipeline template
Merging https://github.com/nf-core/tools/pull/1247 broke a few tests on `dev` which we can fix by reinstalling the modules into the pipeline template, once they have been updated to emit a `versions.yml` in the modules repository (see also https://github.com/nf-core/modules/pull/665) 


Discussion:

Resolving patch:
diff --git a/nf_core/lint/files_exist.py b/nf_core/lint/files_exist.py
--- a/nf_core/lint/files_exist.py
+++ b/nf_core/lint/files_exist.py
@@ -51,7 +51,6 @@ def files_exist(self):
         lib/NfcoreTemplate.groovy
         lib/Utils.groovy
         lib/WorkflowMain.groovy
-        modules/local/get_software_versions.nf
         nextflow_schema.json
         nextflow.config
         README.md
@@ -133,7 +132,6 @@ def files_exist(self):
         [os.path.join("lib", "NfcoreTemplate.groovy")],
         [os.path.join("lib", "Utils.groovy")],
         [os.path.join("lib", "WorkflowMain.groovy")],
-        [os.path.join("modules", "local", "get_software_versions.nf")],
     ]
 
     files_warn = [


Test patch:
diff --git a/tests/modules/lint.py b/tests/modules/lint.py
--- a/tests/modules/lint.py
+++ b/tests/modules/lint.py
@@ -15,6 +15,7 @@ def test_modules_lint_empty(self):
     """Test linting a pipeline with no modules installed"""
     self.mods_remove.remove("fastqc")
     self.mods_remove.remove("multiqc")
+    self.mods_remove.remove("custom/dumpsoftwareversions")
     module_lint = nf_core.modules.ModuleLint(dir=self.pipeline_dir)
     module_lint.lint(print_results=False, all_modules=True)
     assert len(module_lint.passed) == 0
Repository: nf-core/tools

Issue:
nf-core lint throws exception when --dir is used
Running `nf-core lint` throws the following exception when using the `--dir` option

## Steps to reproduce

```bash
$ nf-core lint --dir nf-core-testpipeline

                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 2.2.dev0



ERROR    Could not determine repository type of 'nf-core-testpipeline'                                                                                       __main__.py:345
```
If the lint is run from the pipeline folder it works.

## Expected behaviour

<!-- A clear and concise description of what you expected to happen. -->

## System

- OS: macOS
- Version of nf-core/tools: 2.2.dev0
- Python version: Tested on 3.7 and 3.8

## Additional context

The reason behind the error is that in #1322 the `os.path.join` was removed from the code.



Discussion:

Resolving patch:
diff --git a/nf_core/modules/module_utils.py b/nf_core/modules/module_utils.py
--- a/nf_core/modules/module_utils.py
+++ b/nf_core/modules/module_utils.py
@@ -344,8 +344,8 @@ def get_repo_type(dir):
         raise LookupError("Could not find directory: {}".format(dir))
 
     # Determine repository type
-    if os.path.exists("README.md"):
-        with open("README.md") as fh:
+    if os.path.exists(os.path.join(dir, "README.md")):
+        with open(os.path.join(dir, "README.md")) as fh:
             if fh.readline().rstrip().startswith("# ![nf-core/modules]"):
                 return "modules"
             else:


Test patch:
Repository: nf-core/tools

Issue:
Space missing in tip message for --fix files_unchanged
<!--
# nf-core/tools bug report

Hi there!

Thanks for telling us about a problem with the nf-core/tools package.
Please delete this text and anything that's not relevant from the template below:
-->

## Description of the bug

a space is missing before `--fix files_unchanged`

```
Tip: Some of these linting errors can automatically be resolved with the 
following command:

    nf-core lint --dir /home/runner/work/rnavar/rnavar--fix files_unchanged
```

## Steps to reproduce

https://github.com/nf-core/rnavar/runs/4317868056?check_suite_focus=true#step:6:100

## Expected behaviour

<!-- A clear and concise description of what you expected to happen. -->

## System

- Hardware: <!-- [e.g. HPC, Desktop, Cloud...] -->
- Executor: <!-- [e.g. slurm, local, awsbatch...] -->
- OS: <!-- [e.g. CentOS Linux, macOS, Linux Mint...] -->
- Version of nf-core/tools: <!-- [e.g. 1.1, 1.5, 1.8.2...] -->
- Python version: <!-- [e.g. 3.7, 3.8...] -->

## Nextflow Installation

- Version: <!-- [e.g. 19.10.0] -->

## Additional context

<!-- Add any other context about the problem here. -->



Discussion:
Sorry, I can't reproduce that:
![Screenshot 2021-11-25 at 10 46 32](https://user-images.githubusercontent.com/6169021/143418270-1fc5475d-1dff-4bfd-a81a-144c9ec55c00.png)

And the space is also in the code, so I am a bit lost there...
https://github.com/nf-core/tools/blob/b48bce26b7da46cb71e4a8f78b68d9ceac579ca6/nf_core/lint_utils.py#L41


Do you see the same error as I on the GHA?
We're using `dev` now for the linting.
Ah, you are correct, it is broken in `dev`. Sorry for that.
no worries

Resolving patch:
diff --git a/nf_core/lint_utils.py b/nf_core/lint_utils.py
--- a/nf_core/lint_utils.py
+++ b/nf_core/lint_utils.py
@@ -38,7 +38,7 @@ def print_fixes(lint_obj, module_lint_obj):
     """Prints available and applied fixes"""
 
     if len(lint_obj.could_fix):
-        fix_cmd = "nf-core lint {}--fix {}".format(
+        fix_cmd = "nf-core lint {} --fix {}".format(
             "" if lint_obj.wf_path == "." else f"--dir {lint_obj.wf_path}", " --fix ".join(lint_obj.could_fix)
         )
         console.print(


Test patch:
Repository: nf-core/tools

Issue:
nf-core modules install has duplicated text in message
### Description of the bug

nf-core modules install gives a message with the text
"Recomputing commit SHAs for modules **which which were were** missing from"
The duplicated words should be removed.

### Command used and terminal output

_No response_

### System information

_No response_


Discussion:

Resolving patch:
diff --git a/nf_core/modules/modules_command.py b/nf_core/modules/modules_command.py
--- a/nf_core/modules/modules_command.py
+++ b/nf_core/modules/modules_command.py
@@ -207,7 +207,7 @@ def modules_json_up_to_date(self):
                 log.info(f"Recomputing commit SHA for module {format_missing[0]} which was missing from 'modules.json'")
             else:
                 log.info(
-                    f"Recomputing commit SHAs for modules which which were were missing from 'modules.json': {', '.join(format_missing)}"
+                    f"Recomputing commit SHAs for modules which were missing from 'modules.json': {', '.join(format_missing)}"
                 )
             failed_to_find_commit_sha = []
             for repo, modules in missing_from_modules_json.items():


Test patch:
Repository: nf-core/tools

Issue:
Pin version in URL for lint errors
## Description of the bug

The structure of the tools documentation switched around a bit. The lint errors still use the old version. I implemented a redirect to fix it temporarily (https://github.com/nf-core/nf-co.re/pull/972). But this only redirects to the most recent version. It would be great if the errors are printed with the nf-core tools version encoded in the url.




Discussion:

Resolving patch:
diff --git a/nf_core/lint/__init__.py b/nf_core/lint/__init__.py
--- a/nf_core/lint/__init__.py
+++ b/nf_core/lint/__init__.py
@@ -12,15 +12,14 @@
 import git
 import json
 import logging
-import os
 import re
 import rich
 import rich.progress
-import yaml
 
 import nf_core.utils
 import nf_core.lint_utils
 import nf_core.modules.lint
+from nf_core import __version__
 from nf_core.lint_utils import console
 
 log = logging.getLogger(__name__)
@@ -331,7 +330,14 @@ def format_result(test_results, table):
             string for the terminal with appropriate ASCII colours.
             """
             for eid, msg in test_results:
-                table.add_row(Markdown("[{0}](https://nf-co.re/tools-docs/lint_tests/{0}.html): {1}".format(eid, msg)))
+                tools_version = __version__
+                if "dev" in __version__:
+                    tools_version = "latest"
+                table.add_row(
+                    Markdown(
+                        f"[{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html): {msg}"
+                    )
+                )
             return table
 
         def _s(some_list):


Test patch:
Repository: nf-core/tools

Issue:
modules install to also print/write `include` statements
### Description of feature

print `include` statements to terminal for easy copy to destination files


Discussion:
![](https://github.trello.services/images/mini-trello-icon.png) [nf-core modules install](https://trello.com/c/OM5H3t2X/9-nf-core-modules-install)

Resolving patch:
diff --git a/nf_core/modules/install.py b/nf_core/modules/install.py
--- a/nf_core/modules/install.py
+++ b/nf_core/modules/install.py
@@ -130,6 +130,10 @@ def install(self, module):
         if not self.download_module_file(module, version, self.modules_repo, install_folder):
             return False
 
+        # Print include statement
+        module_name = "_".join(module.upper().split("/"))
+        log.info(f"Include statement: include {{ {module_name} }} from '.{os.path.join(*install_folder, module)}/main’")
+
         # Update module.json with newly installed module
         self.update_modules_json(modules_json, self.modules_repo.name, module, version)
         return True


Test patch:
Repository: nf-core/tools

Issue:
Lint warning on Nextflow minimum version badge
### Description of the bug

`nf-core lint` complains that the minimum version badge for Nextflow could not found, however it was present in the `README.md`.
It occurred after the `template-merge-2.4`
It appears to be a bug.



### Command used and terminal output

```console
(nextflow2) rnavar$ nf-core lint



                                          ,--./,-.

          ___     __   __   __   ___     /,-._.--~\

    |\ | |__  __ /  ` /  \ |__) |__         }  {

    | \| |       \__, \__/ |  \ |___     \`-._,-`-,

                                          `._,._,'



    nf-core/tools version 2.4.1 - https://nf-co.re





INFO     Testing pipeline: .                                                                                                                                                                __init__.py:244



╭─ [!] 1 Pipeline Test Warning ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮

│                                                                                                                                                                                                         │

│ readme: README did not have a Nextflow minimum version badge.                                                                                                                                           │

│                                                                                                                                                                                                         │

╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```


### System information

_No response_


Discussion:

Resolving patch:
diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -38,9 +38,9 @@ def readme(self):
         content = fh.read()
 
     # Check that there is a readme badge showing the minimum required version of Nextflow
-    # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg?labelColor=000000)](https://www.nextflow.io/)
+    # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
     # and that it has the correct version
-    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-%E2%89%A5([\d\.]+)-23aa62\.svg\?labelColor=000000\)\]\(https://www\.nextflow\.io/\)"
+    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-%E2%89%A5([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
     match = re.search(nf_badge_re, content)
     if match:
         nf_badge_version = match.group(1).strip("'\"")


Test patch: