microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
hve-core-v3.3.27

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/contributing/copyright-headers.md

96lines · modecode

1---
2title: Copyright Header Guidelines
3description: Standards for copyright and license headers in source files to meet OpenSSF Best Practices badge criteria
4sidebar_position: 7
5author: Microsoft
6ms.date: 2026-01-31
7ms.topic: reference
8keywords:
9 - copyright
10 - license
11 - SPDX
12 - headers
13 - OpenSSF
14estimated_reading_time: 2
15---
16
17This document defines the copyright and license header format required for source files in the hve-core repository. Following these guidelines ensures compliance with [OpenSSF Best Practices](https://www.bestpractices.dev/en/criteria/2) Gold badge criteria for `copyright_per_file` and `license_per_file`.
18
19## Overview
20
21All source files in this repository must include a copyright and license header. We use the [SPDX License Identifier](https://spdx.org/licenses/) standard to provide machine-readable license information.
22
23## Header Format
24
25### PowerShell Files
26
27```text
28# Copyright (c) Microsoft Corporation.
29# SPDX-License-Identifier: MIT
30```
31
32Applies to: `.ps1` files
33
34### Python Files
35
36```text
37# Copyright (c) Microsoft Corporation.
38# SPDX-License-Identifier: MIT
39```
40
41Applies to: `.py` files
42
43## Placement Rules
44
45The header placement depends on any required directives in the file:
46
47### With #Requires Statements
48
49Place the header **after** any `#Requires` statements:
50
51```powershell
52#Requires -Version 7.0
53#Requires -Modules @{ ModuleName="Pester"; ModuleVersion="5.0" }
54# Copyright (c) Microsoft Corporation.
55# SPDX-License-Identifier: MIT
56
57# Script content starts here
58```
59
60### Without #Requires Statements
61
62If no `#Requires` statements exist, place the header at the first line:
63
64```powershell
65# Copyright (c) Microsoft Corporation.
66# SPDX-License-Identifier: MIT
67
68param(
69 [string]$Path
70)
71```
72
73### Python Files
74
75Place the header **after** any shebang line and **before** PEP 723 inline metadata or the module docstring:
76
77```python
78#!/usr/bin/env python3
79# Copyright (c) Microsoft Corporation.
80# SPDX-License-Identifier: MIT
81```
82
83If no shebang exists, place the header at the first line.
84
85## References
86
87* [Microsoft Open Source](https://opensource.microsoft.com/) - Microsoft's open source program and governance
88* [SPDX License List](https://spdx.org/licenses/) - Standard license identifiers
89* [SPDX License Identifier Specification](https://spdx.github.io/spdx-spec/v2.3/using-SPDX-short-identifiers-in-source-files/) - How to use SPDX identifiers in source files
90* [OpenSSF Best Practices Badge Criteria](https://www.bestpractices.dev/en/criteria/2) - Gold level requirements
91* [PowerShell/PowerShell header example](https://github.com/PowerShell/PowerShell/blob/master/tools/Sign-Package.ps1) - Reference implementation
92
93---
94
95*🤖 Crafted with precision by ✨Copilot following brilliant human instruction,
96then carefully refined by our team of discerning human reviewers.*