Skip to content

Commit

Permalink
Merge pull request #2254 from mashehu/lint-for-zenodo-doi
Browse files Browse the repository at this point in the history
remove bioconda badge check comment, add zenodo doi check
  • Loading branch information
mashehu authored Apr 26, 2023
2 parents 54e3b2e + edb2f57 commit d6cf685
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 15 additions & 7 deletions nf_core/lint/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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](<image URL>)`` *inside* a markdown link ``[markdown image](<link URL>)``, 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](<image URL>)`` *inside* a markdown link ``[markdown image](<link URL>)``, so a bit fiddly to write.
"""
passed = []
warned = []
Expand Down Expand Up @@ -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}

0 comments on commit d6cf685

Please sign in to comment.