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

fix: Update regex to detect all variants of /* istanbul ignore */ comments #3217 #3221

12 changes: 7 additions & 5 deletions .github/workflows/scripts/code_coverage_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ 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))?[^\n]*|
/\*\s*istanbul\s+ignore\s+(?:next|-line)\s*\*/""",
re.IGNORECASE,
)
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,
khushipatil1523 marked this conversation as resolved.
Show resolved Hide resolved
)


try:
with open(file_path, "r", encoding="utf-8") as file:
content = file.read()
Expand Down
Loading