Skip to content

Commit

Permalink
Merge pull request nf-core#2459 from mashehu/fix-linting-report-links
Browse files Browse the repository at this point in the history
fix incorrect links in github linting comment
  • Loading branch information
mirpedrol authored Dec 15, 2023
2 parents 9414faf + 9021880 commit a1d7d0d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pre-commit run --all
## API Documentation

We aim to write function docstrings according to the [Google Python style-guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings). These are used to automatically generate package documentation on the nf-core website using Sphinx.
You can find this documentation here: [https://nf-co.re/tools-docs/](https://nf-co.re/tools-docs/)
You can find this documentation here: [https://nf-co.re/tools/docs/](https://nf-co.re/tools/docs/)

If you would like to test the documentation, you can install Sphinx locally by following Sphinx's [installation instruction](https://www.sphinx-doc.org/en/master/usage/installation.html).
Once done, you can run `make clean` and then `make html` in the `docs/api` directory of `nf-core tools`.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ A python package with helper tools for the nf-core community.
- [Citation](#citation)

The nf-core tools package is written in Python and can be imported and used within other packages.
For documentation of the internal Python functions, please refer to the [Tools Python API docs](https://nf-co.re/tools-docs/).
For documentation of the internal Python functions, please refer to the [Tools Python API docs](https://nf-co.re/tools/docs/).

## Installation

Expand Down Expand Up @@ -186,7 +186,7 @@ for wf in wfs.remote_workflows:
print(wf.full_name)
```

Please see [https://nf-co.re/tools-docs/](https://nf-co.re/tools-docs/) for the function documentation.
Please see [https://nf-co.re/tools/docs/](https://nf-co.re/tools/docs/) for the function documentation.

### Automatic version check

Expand Down Expand Up @@ -533,7 +533,7 @@ Each test result name on the left is a terminal hyperlink.
In most terminals you can <kbd>ctrl</kbd> + <kbd>click</kbd> ( <kbd>cmd</kbd> + <kbd>click</kbd>) these
links to open documentation specific to this test in your browser.

Alternatively visit <https://nf-co.re/tools-docs/lint_tests/index.html> and find your test to read more.
Alternatively visit <https://nf-co.re/tools/docs/latest/pipeline_lint_tests/index.html> and find your test to read more.

### Linting config

Expand Down
2 changes: 1 addition & 1 deletion nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def lint(ctx, dir, release, fix, key, show_passed, fail_ignored, fail_warned, ma
Runs a large number of automated tests to ensure that the supplied pipeline
meets the nf-core guidelines. Documentation of all lint tests can be found
on the nf-core website: [link=https://nf-co.re/tools-docs/]https://nf-co.re/tools-docs/[/]
on the nf-core website: [link=https://nf-co.re/tools/docs/]https://nf-co.re/tools/docs/[/]
You can ignore tests using a file called [blue].nf-core.yml[/] [i](if you have a good reason!)[/].
See the documentation for details.
Expand Down
20 changes: 12 additions & 8 deletions nf_core/lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ def format_result(test_results):
Given an list of error message IDs and the message texts, return a nicely formatted
string for the terminal with appropriate ASCII colours.
"""
tools_version = __version__
if "dev" in __version__:
tools_version = "latest"
for eid, msg in test_results:
tools_version = __version__
if "dev" in __version__:
tools_version = "latest"
yield Markdown(
f"[{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html): {msg}"
)
Expand Down Expand Up @@ -466,6 +466,10 @@ def _get_results_md(self):
if len(self.failed) > 0:
overall_result = "Failed :x:"

tools_version = __version__
if "dev" in __version__:
tools_version = "latest"

# List of tests for details
test_failure_count = ""
test_failures = ""
Expand All @@ -474,7 +478,7 @@ def _get_results_md(self):
test_failures = "### :x: Test failures:\n\n{}\n\n".format(
"\n".join(
[
f"* [{eid}](https://nf-co.re/tools-docs/lint_tests/{eid}.html) - "
f"* [{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html) - "
f"{strip_ansi_codes(msg, '`')}"
for eid, msg in self.failed
]
Expand All @@ -488,7 +492,7 @@ def _get_results_md(self):
test_ignored = "### :grey_question: Tests ignored:\n\n{}\n\n".format(
"\n".join(
[
f"* [{eid}](https://nf-co.re/tools-docs/lint_tests/{eid}.html) - "
f"* [{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html) - "
f"{strip_ansi_codes(msg, '`')}"
for eid, msg in self.ignored
]
Expand All @@ -502,7 +506,7 @@ def _get_results_md(self):
test_fixed = "### :grey_question: Tests fixed:\n\n{}\n\n".format(
"\n".join(
[
f"* [{eid}](https://nf-co.re/tools-docs/lint_tests/{eid}.html) - "
f"* [{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html) - "
f"{strip_ansi_codes(msg, '`')}"
for eid, msg in self.fixed
]
Expand All @@ -516,7 +520,7 @@ def _get_results_md(self):
test_warnings = "### :heavy_exclamation_mark: Test warnings:\n\n{}\n\n".format(
"\n".join(
[
f"* [{eid}](https://nf-co.re/tools-docs/lint_tests/{eid}.html) - "
f"* [{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html) - "
f"{strip_ansi_codes(msg, '`')}"
for eid, msg in self.warned
]
Expand All @@ -531,7 +535,7 @@ def _get_results_md(self):
"\n".join(
[
(
f"* [{eid}](https://nf-co.re/tools-docs/lint_tests/{eid}.html)"
f"* [{eid}](https://nf-co.re/tools/docs/{tools_version}/pipeline_lint_tests/{eid}.html)"
f" - {strip_ansi_codes(msg, '`')}"
)
for eid, msg in self.passed
Expand Down

0 comments on commit a1d7d0d

Please sign in to comment.