From ccdacc117472524dfc459c1c0896ea69bf77908f Mon Sep 17 00:00:00 2001 From: Pradeep Tammali <16902925+PradeepTammali@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:12:07 +0200 Subject: [PATCH 1/2] build: publish package release 1.0 to pypi (#3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b1b397..9b28832 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: From 7e391642c8c32ec3436088c21d3a5a6d2b396d65 Mon Sep 17 00:00:00 2001 From: Pradeep Tammali Date: Fri, 5 Apr 2024 07:06:26 +0200 Subject: [PATCH 2/2] chore: minor changes --- Makefile | 6 ++++++ codecov/main.py | 1 + codecov/settings.py | 1 + codecov/template.py | 2 ++ codecov/template_files/comment.md.j2 | 5 +++++ 5 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 0b15e88..3659a68 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/codecov/main.py b/codecov/main.py index 135b552..e2f1a87 100644 --- a/codecov/main.py +++ b/codecov/main.py @@ -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( diff --git a/codecov/settings.py b/codecov/settings.py index f7aef38..98ac80d 100644 --- a/codecov/settings.py +++ b/codecov/settings.py @@ -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 diff --git a/codecov/template.py b/codecov/template.py index fc27071..8948303 100644 --- a/codecov/template.py +++ b/codecov/template.py @@ -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) @@ -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 diff --git a/codecov/template_files/comment.md.j2 b/codecov/template_files/comment.md.j2 index e66ff38..5b043bb 100644 --- a/codecov/template_files/comment.md.j2 +++ b/codecov/template_files/comment.md.j2 @@ -332,4 +332,9 @@ This report was generated by here. +{%- endif -%} +{%- endblock full_coverage_report %} {{ marker -}}