Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/minor changes #7

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ repos:
- id: commit-msg
name: Check commit message
language: pygrep
entry: '^(chore|test|setup|feature|fix|build|docs|refactor)!?: [a-zA-Z0-9-_ ]+[a-zA-Z0-9-_ ]+.*'
entry: '^(chore|test|setup|feature|fix|build|docs|refactor|release)!?: [a-zA-Z0-9-_ ]+[a-zA-Z0-9-_ ]+.*'
args:
- --negate # fails if the entry is NOT matched
stages:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ lint:
test:
pipenv run pytest tests/* --cov

build:
python3 -m build

publish:
python3 -m twine upload dist/*

run:
pipenv run python run.py

Expand Down
1 change: 1 addition & 0 deletions codecov/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def process_pr( # pylint: disable=too-many-locals
marker=marker,
subproject_id=config.SUBPROJECT_ID,
complete_project_report=config.COMPLETE_PROJECT_REPORT,
coverage_report_url=config.COVERAGE_REPORT_URL,
)
except template.MissingMarker:
log.error(
Expand Down
1 change: 1 addition & 0 deletions codecov/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Config:
ANNOTATION_TYPE: str = 'warning'
MAX_FILES_IN_COMMENT: int = 25
COMPLETE_PROJECT_REPORT: bool = False
COVERAGE_REPORT_URL: str | None = None
# Only for debugging, not exposed in the action
DEBUG: bool = False

Expand Down
2 changes: 2 additions & 0 deletions codecov/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def get_comment_markdown( # pylint: disable=too-many-arguments,too-many-locals
marker: str,
subproject_id: str | None = None,
complete_project_report: bool = False,
coverage_report_url: str | None = None,
):
loader = CommentLoader(base_template=base_template)
env = SandboxedEnvironment(loader=loader)
Expand Down Expand Up @@ -155,6 +156,7 @@ def get_comment_markdown( # pylint: disable=too-many-arguments,too-many-locals
subproject_id=subproject_id,
marker=marker,
complete_project_report=complete_project_report,
coverage_report_url=coverage_report_url,
)
except jinja2.exceptions.TemplateError as exc:
raise TemplateError from exc
Expand Down
5 changes: 5 additions & 0 deletions codecov/template_files/comment.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,9 @@ This report was generated by <a href="{%- if subproject_id %}{{ subproject_id }}
{%- endif -%}
{%- endblock project_coverage_by_file %}

{%- block full_coverage_report -%}
{%- if coverage_report_url %}
#### See the full coverage report of the project <a href="{{ coverage_report_url }}">here</a>.
{%- endif -%}
{%- endblock full_coverage_report %}
{{ marker -}}
Loading