Skip to content

Commit 50bdb2e

Browse files
Copilotsimongdavies
andcommitted
Fix Label Checker test and improve license header script
Co-authored-by: simongdavies <[email protected]> Signed-off-by: Simon Davies <[email protected]>
1 parent bb5b895 commit 50bdb2e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

dev/check-license-headers.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ cd "$REPO_ROOT" || exit 1
88
# Define the license header pattern to look for
99
LICENSE_PATTERN="Copyright .* The Hyperlight Authors..*Licensed under the Apache License, Version 2.0"
1010

11+
# Define the full license header for files that need it
12+
LICENSE_HEADER='/*
13+
Copyright 2024 The Hyperlight Authors.
14+
15+
Licensed under the Apache License, Version 2.0 (the "License");
16+
you may not use this file except in compliance with the License.
17+
You may obtain a copy of the License at
18+
19+
http://www.apache.org/licenses/LICENSE-2.0
20+
21+
Unless required by applicable law or agreed to in writing, software
22+
distributed under the License is distributed on an "AS IS" BASIS,
23+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
See the License for the specific language governing permissions and
25+
limitations under the License.
26+
*/
27+
28+
'
29+
1130
# Initialize a variable to track missing headers
1231
MISSING_HEADERS=0
1332
MISSING_FILES=""
@@ -30,6 +49,10 @@ done < <(find src -name "*.rs" -type f)
3049
if [ $MISSING_HEADERS -gt 0 ]; then
3150
echo "Found $MISSING_HEADERS files with missing or invalid license headers:"
3251
echo -e "$MISSING_FILES"
52+
echo ""
53+
echo "Please add the following license header to these files:"
54+
echo "$LICENSE_HEADER"
55+
echo "You can also run: just check-license-headers to verify your changes."
3356
exit 1
3457
else
3558
echo "All Rust files have the required license header"

0 commit comments

Comments
 (0)