From 63f4fca43494f48798839a6113a6a74d3b68d13c Mon Sep 17 00:00:00 2001 From: Ron DeFreitas <451585+rondefreitas@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:28:20 -0500 Subject: [PATCH] Support existing coveragerc file Add support for users to provide and use an existing .coveragerc file --- entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index fd59aed..f69730f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -87,10 +87,15 @@ fi # write omit str list to coverage file -cat << EOF > "$COV_CONFIG_FILE" +if [ -n "$4" ] && [ -f "./${COV_CONFIG_FILE}" ]; then + >&2 echo "Cannot support both user-provided '$COV_CONFIG_FILE' file along with cov-omit-list configuration." + exit 1 +elif [ -n "$4" ]; then + cat << EOF > "$COV_CONFIG_FILE" [run] omit = $4 EOF +fi if [ -f "./pyproject.toml" ] && [ -f "./poetry.lock" ] then