Skip to content

Commit fab3387

Browse files
committed
Fix coverage info link for non-pretalx-owned plugins
1 parent ae8dcb6 commit fab3387

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

cookiecutter.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"short_description": "pretalx plugin for {{ cookiecutter.human_name }}",
55
"author_name": "Your name",
66
"author_email": "your-email@example.org",
7-
"__repo_name": "{{ cookiecutter.module_name.replace('_', '-') }}",
8-
"__model_name": "{{ cookiecutter.module_name.replace('pretalx_', '').split('_')|map('capitalize')|join }}",
97
"repo_url": "https://github.com/{{ cookiecutter.author_email.split('@')[0] }}/{{ cookiecutter.__repo_name }}",
8+
"__repo_name": "{{ cookiecutter.module_name.replace('_', '-') }}",
9+
"__model_name": "{{ cookiecutter.module_name.replace('pretalx_', '').split('_')|map('capitalize')|join }}",
10+
"__github_path": "{{ cookiecutter.repo_url.replace('https://github.com/', '').replace('http://github.com/', '').replace('.git', '').strip('/') if 'github.com' in cookiecutter.repo_url else '' }}",
1011
"category": ["FEATURE", "INTEGRATION", "CUSTOMIZATION", "EXPORTER", "RECORDING", "LANGUAGE", "OTHER"]
1112
}

{{cookiecutter.__repo_name}}/README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{{cookiecutter.human_name}}
22
==========================
3-
4-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/wiki/{{ cookiecutter.author_email.split('@')[0] }}/{{ cookiecutter.__repo_name }}/python-coverage-comment-action-badge.json
5-
:target: {{ cookiecutter.repo_url }}
3+
{% if cookiecutter.__github_path %}
4+
.. image:: https://raw.githubusercontent.com/{{ cookiecutter.__github_path }}/python-coverage-comment-action-data/badge.svg
5+
:target: https://htmlpreview.github.io/?https://github.com/{{ cookiecutter.__github_path }}/blob/python-coverage-comment-action-data/htmlcov/index.html
66
:alt: Coverage
7-
7+
{% endif %}
88
This is a plugin for `pretalx`_.
99
{{ cookiecutter.short_description }}
1010

{{cookiecutter.__repo_name}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ addopts = "--cov={{cookiecutter.module_name}} --cov-report=term-missing:skip-cov
5353

5454
[tool.coverage.run]
5555
branch = true
56+
relative_files = true
5657
source = ["{{cookiecutter.module_name}}"]
5758
omit = ["*/migrations/*", "*/urls.py", "*/tests/*"]
5859

0 commit comments

Comments
 (0)