Skip to content

Commit

Permalink
suggestions 2
Browse files Browse the repository at this point in the history
  • Loading branch information
prayanshchh committed Jan 6, 2025
1 parent bbcbdb9 commit 0d4252c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/scripts/biome_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
Recursively analyzes specified files or directories to ensure they do
not contain biome-ignore statements.
Recursively analyzes specified files or directories to ensure they do
not contain biome-ignore statements.
This script enforces code quality practices in the project.
NOTE:
Expand All @@ -24,7 +27,6 @@
import re
import argparse
import sys
from typing import List


def has_biome_ignore(file_path: str) -> bool:
Expand All @@ -37,10 +39,7 @@ def has_biome_ignore(file_path: str) -> bool:
Returns:
bool: True if biome-ignore statement is found, False otherwise.
"""
biome_ignore_pattern = re.compile(
r"//\s*biome-ignore[^]*",
re.IGNORECASE,
)
biome_ignore_pattern = re.compile(r"//\s*biome-ignore.*$", re.IGNORECASE | re.MULTILINE)

try:
with open(file_path, encoding="utf-8") as file:
Expand All @@ -57,7 +56,7 @@ def has_biome_ignore(file_path: str) -> bool:
return False


def check_biome(files_or_directories: List[str]) -> bool:
def check_biome(files_or_directories: list[str]) -> bool:
"""
Check files for biome-ignore statements.
Expand Down

0 comments on commit 0d4252c

Please sign in to comment.