From 201a93c47fab867a069da4eac65ee31f2a57f5ee Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 26 Apr 2023 13:08:12 +0200 Subject: [PATCH 1/2] remove bioconda badge check comment, add zenodo doi check --- CHANGELOG.md | 2 ++ nf_core/lint/readme.py | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6144cbb834..6d9c83741f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,12 +16,14 @@ - Simplify pipeline README ([#2186](https://github.com/nf-core/tools/issues/2186)) - Added support for the apptainer container engine via `-profile apptainer`. ([#2244](https://github.com/nf-core/tools/issues/2244)) [Contributed by @jfy133] - Add tower.yml file to the pipeline template ([#2251](https://github.com/nf-core/tools/pull/2251)) +- Add mastodon badge to README ([#2253](https://github.com/nf-core/tools/pull/2253)) ### Linting - Update modules lint test to fail if enable_conda is found ([#2213](https://github.com/nf-core/tools/pull/2213)) - Read module lint configuration from `.nf-core.yml`, not `.nf-core-lint.yml` ([#2221](https://github.com/nf-core/tools/pull/2221)) - `nf-core schema lint` now defaults to linting `nextflow_schema.json` if no filename is provided ([#2225](https://github.com/nf-core/tools/pull/2225)) +- Warn if `/zenodo.XXXXXX` is present in the Readme ([#2254](https://github.com/nf-core/tools/pull/2254)) ### Modules diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py index 5f6dd87030..ae5c542837 100644 --- a/nf_core/lint/readme.py +++ b/nf_core/lint/readme.py @@ -17,16 +17,12 @@ def readme(self): [![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.27.6-brightgreen.svg)](https://www.nextflow.io/) - * Bioconda badge + .. note:: This badge are a markdown image ``![alt-text]()`` *inside* a markdown link ``[markdown image]()``, so a bit fiddly to write. - * If your pipeline contains a file called ``environment.yml`` in the root directory, a bioconda badge is required - * Required badge code: + * Zenodo release - .. code-block:: md - - [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](https://bioconda.github.io/) + * If pipeline is released but still contains a 'zenodo.XXXXXXX' tag, the test fails - .. note:: These badges are a markdown image ``![alt-text]()`` *inside* a markdown link ``[markdown image]()``, so a bit fiddly to write. """ passed = [] warned = [] @@ -62,4 +58,16 @@ def readme(self): else: warned.append("README did not have a Nextflow minimum version badge.") + if "zenodo_doi" not in ignore_configs: + # Check that zenodo.XXXXXXX has been replaced with the zendo.DOI + zenodo_re = r"/zenodo\.X+" + match = re.search(zenodo_re, content) + if match: + warned.append( + "README contains the placeholder `zenodo.XXXXXXX`. " + "This should be replaced with the zenodo doi (after the first release)." + ) + else: + passed.append("README Zenodo placeholder was replaced with DOI.") + return {"passed": passed, "warned": warned, "failed": failed} From edb2f57e6cfe8468f5a4598b7a05af73580e20b3 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 26 Apr 2023 14:10:32 +0200 Subject: [PATCH 2/2] remove zenodo template string when running create-lint-wf --- .github/workflows/create-lint-wf.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index f76187d6af..46152d92a7 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -84,6 +84,10 @@ jobs: - name: remove TODO run: find nf-core-testpipeline -type f -exec sed -i '/TODO nf-core:/d' {} \; + # Replace zenodo.XXXXXX to pass readme linting + - name: replace zenodo.XXXXXX + run: find nf-core-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \; + # Run nf-core linting - name: nf-core lint run: nf-core --log-file log.txt --hide-progress lint --dir nf-core-testpipeline --fail-ignored --fail-warned