From 0e3edffdee36cc421713d168e23176d3a541039c Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 15 Mar 2022 21:09:14 +0100 Subject: [PATCH] Updated URL for pipeline lint test docs Fixes #1348 --- CHANGELOG.md | 1 + nf_core/lint/__init__.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fa099add..1e62ae9be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ * Prevent module linting KeyError edge case ([#1321](https://github.com/nf-core/tools/issues/1321)) * Bump-versions: Don't trim the trailing newline on files, causes editorconfig linting to fail ([#1265](https://github.com/nf-core/tools/issues/1265)) * Handle exception in `nf-core list` when a broken git repo is found ([#1273](https://github.com/nf-core/tools/issues/1273)) +* Updated URL for pipeline lint test docs ([#1348](https://github.com/nf-core/tools/issues/1348)) ### Modules diff --git a/nf_core/lint/__init__.py b/nf_core/lint/__init__.py index 483872692..14f3667e2 100644 --- 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):