From 243fa54a47c6f4d65d705ea9e2034e8dddb4d45d Mon Sep 17 00:00:00 2001 From: khushi patil Date: Thu, 9 Jan 2025 19:25:28 +0530 Subject: [PATCH 1/6] fix: Update regex to detect all variants of /* istanbul ignore */ comments --- .github/workflows/scripts/code_coverage_disable_check.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index 1a55c3f720..50c4a8b438 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -38,10 +38,10 @@ def has_code_coverage_disable(file_path): otherwise. """ code_coverage_disable_pattern = re.compile( - r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*| - /\*\s*istanbul\s+ignore\s+(?:next|-line)\s*\*/""", - re.IGNORECASE, - ) + r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line)(?:\s*--\s*\S*)?)?[^\n]*| + /\*\s*istanbul\s+ignore\s+(?:next|-line)(?:\s*--\s*\S*)?\s*\*/""", + re.IGNORECASE, +) try: with open(file_path, "r", encoding="utf-8") as file: content = file.read() From 0a12679b4c29b83074202901dec77ae8b988b557 Mon Sep 17 00:00:00 2001 From: khushi santosh patil <143253539+khushipatil1523@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:43:04 +0530 Subject: [PATCH 2/6] Update code_coverage_disable_check.py --- .github/workflows/scripts/code_coverage_disable_check.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index 50c4a8b438..c42a269b0a 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -37,11 +37,12 @@ def has_code_coverage_disable(file_path): bool: True if code coverage disable statement is found, False otherwise. """ - code_coverage_disable_pattern = re.compile( - r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line)(?:\s*--\s*\S*)?)?[^\n]*| - /\*\s*istanbul\s+ignore\s+(?:next|-line)(?:\s*--\s*\S*)?\s*\*/""", + code_coverage_disable_pattern = re.compile( + r"""//?\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?[^\n]*| + /\*\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?\s*\*/""", re.IGNORECASE, ) + try: with open(file_path, "r", encoding="utf-8") as file: content = file.read() From a8d0a7b727b25f0bbebea6df99100ed8e8462360 Mon Sep 17 00:00:00 2001 From: khushi santosh patil <143253539+khushipatil1523@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:47:29 +0530 Subject: [PATCH 3/6] Update code_coverage_disable_check.py --- .github/workflows/scripts/code_coverage_disable_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index c42a269b0a..7e4c2f5184 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -43,6 +43,7 @@ def has_code_coverage_disable(file_path): re.IGNORECASE, ) + try: with open(file_path, "r", encoding="utf-8") as file: content = file.read() From c612d5590819ca4c34e1c6f151069353de78c24b Mon Sep 17 00:00:00 2001 From: khushi patil Date: Thu, 9 Jan 2025 19:53:23 +0530 Subject: [PATCH 4/6] fix: Update regex to detect all variants of /* istanbul ignore */ comments --- .github/workflows/scripts/code_coverage_disable_check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index 50c4a8b438..5cd89bdf49 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -38,10 +38,11 @@ def has_code_coverage_disable(file_path): otherwise. """ code_coverage_disable_pattern = re.compile( - r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line)(?:\s*--\s*\S*)?)?[^\n]*| - /\*\s*istanbul\s+ignore\s+(?:next|-line)(?:\s*--\s*\S*)?\s*\*/""", + r"""//?\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?[^\n]*| + /\*\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?\s*\*/""", re.IGNORECASE, ) + try: with open(file_path, "r", encoding="utf-8") as file: content = file.read() From 5825453d35da50a0c8a5c132065ddb5cab19a90d Mon Sep 17 00:00:00 2001 From: khushi patil Date: Thu, 9 Jan 2025 20:04:22 +0530 Subject: [PATCH 5/6] fix: Update regex to detect all variants of /* istanbul ignore */ comments --- .github/workflows/scripts/code_coverage_disable_check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index 5cd89bdf49..61c1f90091 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -39,10 +39,11 @@ def has_code_coverage_disable(file_path): """ code_coverage_disable_pattern = re.compile( r"""//?\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?[^\n]*| - /\*\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?\s*\*/""", + /\*.*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?.*\*/""", re.IGNORECASE, ) + try: with open(file_path, "r", encoding="utf-8") as file: content = file.read() From cc76e265cf92d872d5731c0b1c2bb634709039c9 Mon Sep 17 00:00:00 2001 From: khushi patil Date: Fri, 10 Jan 2025 09:02:59 +0530 Subject: [PATCH 6/6] fix: Update regex to detect all variants of /* istanbul ignore */ comments --- .github/workflows/scripts/code_coverage_disable_check.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/code_coverage_disable_check.py b/.github/workflows/scripts/code_coverage_disable_check.py index 61c1f90091..bda4066f03 100644 --- a/.github/workflows/scripts/code_coverage_disable_check.py +++ b/.github/workflows/scripts/code_coverage_disable_check.py @@ -38,10 +38,9 @@ def has_code_coverage_disable(file_path): otherwise. """ code_coverage_disable_pattern = re.compile( - r"""//?\s*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?[^\n]*| - /\*.*istanbul\s+ignore(?:\s+(?:next|line)(?:\s*--\s*\S*)?)?.*\*/""", - re.IGNORECASE, -) + r"/\*\s*istanbul\s+ignore.*?\*/|//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*", + re.IGNORECASE, + ) try: