Generate copyright declaration header Args: relative_path: File path relative to project root Returns: Formatted copyright declaration string
(relative_path: str)
| 65 | |
| 66 | |
| 67 | def generate_copyright_header(relative_path: str) -> str: |
| 68 | """ |
| 69 | Generate copyright declaration header |
| 70 | |
| 71 | Args: |
| 72 | relative_path: File path relative to project root |
| 73 | |
| 74 | Returns: |
| 75 | Formatted copyright declaration string |
| 76 | """ |
| 77 | file_url = f"{REPO_URL}/blob/main/{relative_path}" |
| 78 | |
| 79 | header = f"""# Copyright (c) {COPYRIGHT_YEAR} {EMAIL} |
| 80 | # |
| 81 | # This file is part of MediaCrawler project. |
| 82 | # Repository: {file_url} |
| 83 | # GitHub: {GITHUB_PROFILE} |
| 84 | # Licensed under {LICENSE_TYPE} |
| 85 | #""" |
| 86 | |
| 87 | return header |
| 88 | |
| 89 | |
| 90 | def has_copyright_header(content: str) -> bool: |