devops.cpp.license_header
Module to check for license headers in C++ files.
Functions
|
Add the license header to the file content if it's missing. |
|
Check if the file content starts with the required license header. |
Classes
|
Rule to check for the presence of a license header in C++ files. |
- devops.cpp.license_header.check_license_header(file_rule_input, required_header_file)[source]
Check if the file content starts with the required license header.
- Parameters:
file_rule_input (FileRuleInput) – The input containing the file content and path to check.
required_header_file (str | Path) – The path to the file containing the required license header.
- Returns:
ResultType – The result of the license header check.
- Raises:
DevOpsFileNotFoundError – If the required header file does not exist.
- Return type:
- devops.cpp.license_header.add_license_header(file, header_to_add, *, dry_run=False)[source]
Add the license header to the file content if it’s missing.
- Parameters:
- Returns:
bool – True if the license header was added, False if it was already present.
- Raises:
DevOpsFileNotFoundError – If the header file does not exist.
- Return type: