bundle.docs.copyright ===================== .. py:module:: bundle.docs.copyright Attributes ---------- .. autoapisummary:: bundle.docs.copyright.log Functions --------- .. autoapisummary:: bundle.docs.copyright.render_header bundle.docs.copyright.scan_copyright bundle.docs.copyright.update_copyright_year bundle.docs.copyright.add_copyright_header Module Contents --------------- .. py:data:: log .. py:function:: render_header(year: int, owner: str, suffix: str) -> str Render a copyright + license header for the given file type. :param year: Copyright year. :param owner: Copyright holder name. :param suffix: File extension (e.g. ".py", ".cpp"). :returns: The formatted header string, or empty string for unsupported types. .. py:function:: scan_copyright(root: pathlib.Path, extensions: tuple[str, Ellipsis] = ('.py', '.cpp', '.c', '.h', '.hpp'), exclude_patterns: tuple[str, Ellipsis] = ('__pycache__', '_version.py', 'vendor', 'node_modules')) -> tuple[list[pathlib.Path], list[pathlib.Path]] Scan a directory tree and classify files by copyright header presence. :param root: Directory to scan recursively. :param extensions: File extensions to check. :param exclude_patterns: Path substrings to skip. :returns: Tuple of (files_with_copyright, files_without_copyright). .. py:function:: update_copyright_year(path: pathlib.Path, new_year: int) -> bool Update the copyright year in a file's header. :param path: File to update. :param new_year: Year to set. :returns: True if the file was modified, False if no copyright line was found. .. py:function:: add_copyright_header(path: pathlib.Path, year: int, owner: str) -> bool Prepend a copyright + license header to a file that lacks one. :param path: File to prepend the header to. :param year: Copyright year. :param owner: Copyright holder name. :returns: True if the header was added, False if unsupported extension or already present.