From 43465d3a66e83b37104a4acf87d2a44db1f79760 Mon Sep 17 00:00:00 2001
From: Sebastien Guizard <sguizard@ed.ac.uk>
Date: Wed, 1 Jun 2022 11:54:42 +0100
Subject: [PATCH 1/5] Update readme.py nf version validation regexp

---
 nf_core/lint/readme.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
index 6541922a3b..712b406161 100644
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -40,7 +40,7 @@ def readme(self):
     # Check that there is a readme badge showing the minimum required version of Nextflow
     # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
     # and that it has the correct version
-    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-%E2%89%A5([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
+    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[^\d\.-]+([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
     match = re.search(nf_badge_re, content)
     if match:
         nf_badge_version = match.group(1).strip("'\"")

From 54bf8e35628b66fc0bf54aac91ba33f4b5dc50f6 Mon Sep 17 00:00:00 2001
From: Sebastien Guizard <sguizard@ed.ac.uk>
Date: Wed, 1 Jun 2022 12:04:47 +0100
Subject: [PATCH 2/5] Update CHANGLOG

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9293e6e501..9b64ce6b07 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
 ### Linting
 
 - Check that the `.prettierignore` file exists and that starts with the same content.
+- Update `readme.py` nf version badge validation regexp to accept any signs before version number ([#1613](https://github.com/nf-core/tools/issues/1613))
 
 ### General
 

From 4957eaec509359c5c8d997e2586eee21d05a844f Mon Sep 17 00:00:00 2001
From: Sebastien Guizard <sguizard@ed.ac.uk>
Date: Wed, 1 Jun 2022 12:25:16 +0100
Subject: [PATCH 3/5] Base regexp on encoded URL

---
 nf_core/lint/readme.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
index 712b406161..5800ed88fa 100644
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -40,7 +40,7 @@ def readme(self):
     # Check that there is a readme badge showing the minimum required version of Nextflow
     # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
     # and that it has the correct version
-    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[^\d\.-]+([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
+    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[\d\w%]+(\d{1,2}\.\d{1,2}\.\d{1,2})-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
     match = re.search(nf_badge_re, content)
     if match:
         nf_badge_version = match.group(1).strip("'\"")

From e5b6a7b76c53a7e8650c22e10a86c5d0db64b3c7 Mon Sep 17 00:00:00 2001
From: Sebastien Guizard <sguizard@ed.ac.uk>
Date: Wed, 1 Jun 2022 12:30:00 +0100
Subject: [PATCH 4/5] Force Major version to have two digits

---
 nf_core/lint/readme.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
index 5800ed88fa..43fecaa1bd 100644
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -40,7 +40,7 @@ def readme(self):
     # Check that there is a readme badge showing the minimum required version of Nextflow
     # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
     # and that it has the correct version
-    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[\d\w%]+(\d{1,2}\.\d{1,2}\.\d{1,2})-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
+    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[\d\w%]+(\d{2}\.\d{1,2}\.\d{1,2})-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
     match = re.search(nf_badge_re, content)
     if match:
         nf_badge_version = match.group(1).strip("'\"")

From f1c16986329a4dbd20bdf5c4d662c38c28a468aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Guizard?= <sguizard@ed.ac.uk>
Date: Thu, 2 Jun 2022 11:39:39 +0100
Subject: [PATCH 5/5] Update nf_core/lint/readme.py

Co-authored-by: Fabian Egli <fabianegli@users.noreply.github.com>
---
 nf_core/lint/readme.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nf_core/lint/readme.py b/nf_core/lint/readme.py
index 43fecaa1bd..bdfaf5601d 100644
--- a/nf_core/lint/readme.py
+++ b/nf_core/lint/readme.py
@@ -40,7 +40,7 @@ def readme(self):
     # Check that there is a readme badge showing the minimum required version of Nextflow
     # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
     # and that it has the correct version
-    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-[\d\w%]+(\d{2}\.\d{1,2}\.\d{1,2})-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
+    nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-!?(?:%E2%89%A5|%3E%3D)([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)"
     match = re.search(nf_badge_re, content)
     if match:
         nf_badge_version = match.group(1).strip("'\"")