From 12c02cb97912eb6013139e35f03a36ab9332da15 Mon Sep 17 00:00:00 2001 From: cyrraz Date: Wed, 10 Dec 2025 10:28:41 +0100 Subject: [PATCH 1/2] feat: add badge for code coverage --- README.md | 3 ++- {{cookiecutter.project_name}}/README.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d720dcf0..47b8d4a8 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ backports structure with a small typing example. - Replaces Flake8, isort, pyupgrade, yesqa, pycln, and dozens of plugins - Includes spell checking - One of several popular licenses -- An pylint nox target can be used to run pylint, which integrated GHA +- A pylint nox target can be used to run pylint, which integrated GHA annotations - A ReadTheDocs-ready Sphinx or MkDocs `docs/` folder and `docs` dependency-group @@ -157,6 +157,7 @@ backports structure with a small typing example. - A dev group for `uv run` integration - A noxfile is included with a few common targets - A README +- Code coverage reporting with automatic uploads to Codecov after tests run #### For developers: diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md index 8fab55ce..dcd7bfa6 100644 --- a/{{cookiecutter.project_name}}/README.md +++ b/{{cookiecutter.project_name}}/README.md @@ -11,6 +11,8 @@ {%- if cookiecutter.org | lower == "scikit-hep" %} [![Scikit-HEP][sk-badge]](https://scikit-hep.org/) {%- endif %} +[![Coverage][coverage-badge]][coverage-link] + {%- if cookiecutter.docs == "sphinx" %} @@ -31,5 +33,7 @@ {%- if cookiecutter.org | lower == "scikit-hep" %} [sk-badge]: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg {%- endif %} +[coverage-badge]: https://codecov.io/gh/{{cookiecutter.org}}/{{cookiecutter.project_name}}/branch/main/graph/badge.svg +[coverage-link]: https://codecov.io/gh/{{cookiecutter.org}}/{{cookiecutter.project_name}} From c2a376556310ef7e6354d118f07c0cfc30f58694 Mon Sep 17 00:00:00 2001 From: cyrraz Date: Thu, 11 Dec 2025 10:30:20 +0100 Subject: [PATCH 2/2] feat: support gitlab in codecov badge --- {{cookiecutter.project_name}}/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md index dcd7bfa6..47823302 100644 --- a/{{cookiecutter.project_name}}/README.md +++ b/{{cookiecutter.project_name}}/README.md @@ -33,7 +33,7 @@ {%- if cookiecutter.org | lower == "scikit-hep" %} [sk-badge]: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg {%- endif %} -[coverage-badge]: https://codecov.io/gh/{{cookiecutter.org}}/{{cookiecutter.project_name}}/branch/main/graph/badge.svg -[coverage-link]: https://codecov.io/gh/{{cookiecutter.org}}/{{cookiecutter.project_name}} +[coverage-badge]: https://codecov.io/{{cookiecutter.__ci}}/{{cookiecutter.org}}/{{cookiecutter.project_name}}/branch/main/graph/badge.svg +[coverage-link]: https://codecov.io/{{cookiecutter.__ci}}/{{cookiecutter.org}}/{{cookiecutter.project_name}}