Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions scripts/update_license_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def has_license_header(file_content: str) -> bool:
def should_add_license_header(file_path: Path) -> bool:
"""Determine if a file should have a license header added."""
# Skip certain files
skip_patterns = [
skip_patterns = (
"__pycache__",
".pyc",
".pyo",
Expand All @@ -76,13 +76,12 @@ def should_add_license_header(file_path: Path) -> bool:
"node_modules",
".venv",
"venv",
]
)

# Skip if file path contains any skip patterns
file_str = str(file_path)
for pattern in skip_patterns:
if pattern in file_str:
return False
if file_str.endswith(skip_patterns):
return False

# Only process Python files
if file_path.suffix != ".py":
Expand Down
Loading