Skip to content

Commit f0e8b8d

Browse files
authored
Merge pull request #3800 from nf-core/fix/lint_multiqc_org
Use the org from .nf-core.yml when linting multiqc_config report_comment
2 parents 4942d71 + d855b3e commit f0e8b8d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- ignore files in gitignore also for pipeline_if_empty_null lint test ([#3722](https://github.com/nf-core/tools/pull/3722))
2121
- do not check pytest_modules.yml file, deprecating ([#3748](https://github.com/nf-core/tools/pull/3748))
2222
- Use the org from the .nf-core.yml when linting manifest name and homePage. ([#3767](https://github.com/nf-core/tools/pull/3767))
23+
- Use the org from .nf-core.yml when linting multiqc_config report_comment ([#3800](https://github.com/nf-core/tools/pull/3800))
2324

2425
### Modules
2526

nf_core/pipelines/lint/multiqc_config.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import yaml
44

55
from nf_core.pipelines.lint_utils import ignore_file
6+
from nf_core.utils import load_tools_config
67

78

89
def multiqc_config(self) -> dict[str, list[str]]:
@@ -98,17 +99,24 @@ def multiqc_config(self) -> dict[str, list[str]]:
9899
if "report_comment" not in ignore_configs:
99100
# Check that the minimum plugins exist and are coming first in the summary
100101
version = self.nf_config.get("manifest.version", "").strip(" '\"")
102+
103+
# Get the org from .nf-core.yml config, defaulting to "nf-core"
104+
_, nf_core_yaml_config = load_tools_config(self.wf_path)
105+
org_name = "nf-core"
106+
if nf_core_yaml_config and getattr(nf_core_yaml_config, "template", None):
107+
org_name = getattr(nf_core_yaml_config.template, "org", org_name) or org_name
108+
101109
if "dev" in version:
102110
version = "dev"
103111
report_comments = (
104-
f'This report has been generated by the <a href="https://github.com/nf-core/{self.pipeline_name}/tree/dev" target="_blank">nf-core/{self.pipeline_name}</a>'
112+
f'This report has been generated by the <a href="https://github.com/{org_name}/{self.pipeline_name}/tree/dev" target="_blank">{org_name}/{self.pipeline_name}</a>'
105113
f" analysis pipeline. For information about how to interpret these results, please see the "
106114
f'<a href="https://nf-co.re/{self.pipeline_name}/dev/docs/output" target="_blank">documentation</a>.'
107115
)
108116

109117
else:
110118
report_comments = (
111-
f'This report has been generated by the <a href="https://github.com/nf-core/{self.pipeline_name}/releases/tag/{version}" target="_blank">nf-core/{self.pipeline_name}</a>'
119+
f'This report has been generated by the <a href="https://github.com/{org_name}/{self.pipeline_name}/releases/tag/{version}" target="_blank">{org_name}/{self.pipeline_name}</a>'
112120
f" analysis pipeline. For information about how to interpret these results, please see the "
113121
f'<a href="https://nf-co.re/{self.pipeline_name}/{version}/docs/output" target="_blank">documentation</a>.'
114122
)

0 commit comments

Comments
 (0)