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

5 changes: 3 additions & 2 deletions .github/workflows/scripts/code_coverage_disable_check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Code Coverage Disable Checker Script.

Check warning on line 1 in .github/workflows/scripts/code_coverage_disable_check.py

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.

Methodology:

Expand Down Expand Up @@ -38,10 +38,11 @@
otherwise.
"""
code_coverage_disable_pattern = re.compile(
r"""//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*|
/\*\s*istanbul\s+ignore\s+(?:next|-line)\s*\*/""",
r"/\*\s*istanbul\s+ignore.*?\*/|//?\s*istanbul\s+ignore(?:\s+(?:next|-line))?[^\n]*",
re.IGNORECASE,
)


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