Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Triton inference server Server CheckCopyright

From Leeroopedia
Knowledge Sources
Domains Developer_Tools, Compliance
Last Updated 2026-02-13 17:00 GMT

Overview

Validates that all source files in the repository contain correct and up-to-date copyright headers.

Description

The `check_copyright.py` script scans source files across the Triton Inference Server repository to ensure each file includes the required copyright notice with the correct year range. It supports multiple file types including Python, C/C++, shell scripts, protobuf, and configuration files, each with their respective comment styles. The script is typically invoked as part of CI pre-commit checks to enforce compliance before code is merged.

Usage

Run this script from the repository root during development or as part of a CI pipeline to catch missing or outdated copyright headers before submitting a pull request.

Code Reference

Source Location

Signature

def check_copyright(path, verbose=False):
    """Check copyright header in a single file."""

def check_files(root_dir, skip_dirs=None, file_extensions=None):
    """Recursively check copyright in all matching files."""

def main():
    """Entry point: parse args, walk directories, report violations."""

Import

# Typically run as a standalone script
python qa/common/check_copyright.py --path /path/to/repo

I/O Contract

Inputs

Name Type Required Description
path string Yes Root directory path to scan for source files
verbose bool No Enable verbose output listing each file checked
skip_dirs list[string] No Directory names to exclude from scanning
file_extensions list[string] No File extensions to check (defaults to all known types)

Outputs

Name Type Description
exit_code int 0 if all files pass, 1 if any violations found
violation_report stdout List of files with missing or incorrect copyright headers

Usage Examples

Check Entire Repository

cd /workspace/server
python qa/common/check_copyright.py --path .

Verbose Check on Specific Directory

python qa/common/check_copyright.py --path ./src --verbose

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment