Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiqc_config.yml links #2372

Merged
merged 9 commits into from
Jul 18, 2023
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Template

- Fix links in `multiqc_config.yml` ([#2372](https://github.com/nf-core/tools/pull/2372))
- Remove default false from nextflow_schema.json ([#2376](https://github.com/nf-core/tools/pull/2376))
- Add module MULTIQC to modules.config ([#2377](https://github.com/nf-core/tools/pull/2377))

Expand Down
9 changes: 7 additions & 2 deletions nf_core/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ def bump_pipeline_version(pipeline_obj, new_version):
],
)
# multiqc_config.yaml
multiqc_new_version = "dev" if "dev" in new_version else new_version
update_file_version(
Path("assets", "multiqc_config.yml"),
pipeline_obj,
[
(
"/dev",
f"/{multiqc_new_version}",
),
(
rf"{re.escape(current_version)}",
f"{new_version}",
)
f"{multiqc_new_version}",
),
],
)

Expand Down
5 changes: 3 additions & 2 deletions nf_core/lint/multiqc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ def multiqc_config(self):
# Check that the minimum plugins exist and are coming first in the summary
try:
version = self.nf_config.get("manifest.version", "").strip(" '\"")
version = "dev" if "dev" in version else version
if "report_comment" not in mqc_yml:
raise AssertionError()
if mqc_yml["report_comment"].strip() != (
f'This report has been generated by the <a href="https://github.com/nf-core/{self.pipeline_name}/{version}" '
f'This report has been generated by the <a href="https://github.com/nf-core/{self.pipeline_name}/tree/{version}" '
Copy link
Contributor

@SusiJo SusiJo Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on line 74:
What about checking if the 'manifest.version' contains the 'dev' tag? Then it would also be possible to refer to the dev version of the pipeline and documentation and wouldn't create a false link.

if ("dev" in version):
    version = "dev"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, thanks for the suggestion! I have pushed the changes :)

f'target="_blank">nf-core/{self.pipeline_name}</a> analysis pipeline. For information about how to '
f'interpret these results, please see the <a href="https://nf-co.re/{self.pipeline_name}/{version}/output" '
f'interpret these results, please see the <a href="https://nf-co.re/{self.pipeline_name}/{version}/docs/output" '
'target="_blank">documentation</a>.'
):
raise AssertionError()
Expand Down
10 changes: 8 additions & 2 deletions nf_core/pipeline-template/assets/multiqc_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
report_comment: >
This report has been generated by the <a href="https://github.com/{{ name }}/{{ version}}" target="_blank">{{ name }}</a>
{% if 'dev' in version -%}
This report has been generated by the <a href="https://github.com/{{ name }}/tree/dev" target="_blank">{{ name }}</a>
analysis pipeline.{% if branded %} For information about how to interpret these results, please see the
<a href="https://nf-co.re/{{ short_name }}/{{ version }}/output" target="_blank">documentation</a>.{% endif %}
<a href="https://nf-co.re/{{ short_name }}/dev/docs/output" target="_blank">documentation</a>.{% endif %}
{%- else %}
This report has been generated by the <a href="https://github.com/{{ name }}/tree/{{ version }}" target="_blank">{{ name }}</a>
analysis pipeline.{% if branded %} For information about how to interpret these results, please see the
<a href="https://nf-co.re/{{ short_name }}/{{ version }}/docs/output" target="_blank">documentation</a>.{% endif %}
{% endif %}
report_section_order:
"{{ name_noslash }}-methods-description":
order: -1000
Expand Down