Skip to content

Commit 1773722

Browse files
authored
Add copyright 2026 headers for source code (#22)
* Add copyright 2026 headers for source code Signed-off-by: Doru Blânzeanu <dblnz@pm.me> * [ci] Add licence headers checks - Also reorder CI jobs alphabetically Signed-off-by: Doru Blânzeanu <dblnz@pm.me> --------- Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
1 parent 5f7e9ae commit 1773722

58 files changed

Lines changed: 893 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ValidatePullRequests.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,43 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
spelling:
21-
name: Spell check with typos
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v6
25-
- name: Spell Check Repo
26-
uses: crate-ci/typos@v1.43.5
27-
28-
build:
29-
uses: ./.github/workflows/dep_build.yml
30-
secrets: inherit
31-
3220
benchmarks:
3321
uses: ./.github/workflows/dep_benchmarks.yml
3422
secrets: inherit
3523
with:
3624
download-benchmarks: true
3725
upload-benchmarks: false
38-
26+
27+
build:
28+
uses: ./.github/workflows/dep_build.yml
29+
secrets: inherit
30+
31+
license-headers:
32+
name: check license headers
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v6
36+
- name: Check License Headers
37+
run: ./dev/check-license-headers.sh
38+
3939
# Gate PR merges on this specific "join-job" which requires all other
4040
# jobs to run first.
4141
report-ci-status:
4242
needs:
43-
- build
4443
- benchmarks
44+
- build
45+
- license-headers
4546
- spelling
4647
if: always()
4748
runs-on: ubuntu-latest
4849
steps:
4950
- name: calculate the correct exit status
50-
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
51+
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
52+
53+
spelling:
54+
name: Spell check with typos
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v6
58+
- name: Spell Check Repo
59+
uses: crate-ci/typos@v1.43.5

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ check-npm:
3535
check:
3636
cargo check
3737

38+
check-license-headers:
39+
./dev/check-license-headers.sh
40+
3841
clippy target=default-target features="": (ensure-tools)
3942
cd src/hyperlight-js-runtime && \
4043
cargo hyperlight clippy \

dev/check-license-headers.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
# This script checks for the presence of the required license header in Rust source files.
3+
4+
# Get the repository root
5+
REPO_ROOT="$(git rev-parse --show-toplevel)"
6+
cd "$REPO_ROOT" || exit 1
7+
8+
# Define the license header pattern to look for
9+
LICENSE_PATTERN="Copyright .* The Hyperlight Authors..*Licensed under the Apache License, Version 2.0"
10+
11+
# Define the full license header for files that need it
12+
LICENSE_HEADER='/*
13+
Copyright 2026 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+
30+
# Initialize a variable to track missing headers
31+
MISSING_HEADERS=0
32+
MISSING_FILES=""
33+
34+
# Find all Rust files
35+
while IFS= read -r -d $'\0' file; do
36+
# Check if the file has the license header (allowing for multi-line matching)
37+
if ! grep -q -z "$LICENSE_PATTERN" "$file"; then
38+
echo "Missing or invalid license header in $file"
39+
MISSING_FILES="$MISSING_FILES\n $file"
40+
MISSING_HEADERS=$((MISSING_HEADERS + 1))
41+
fi
42+
done < <(find src -name "*.rs" -type f -print0)
43+
44+
if [ $MISSING_HEADERS -gt 0 ]; then
45+
echo "Found $MISSING_HEADERS files with missing or invalid license headers:"
46+
echo -e "$MISSING_FILES"
47+
echo ""
48+
echo "Please add the following license header to these files:"
49+
echo "$LICENSE_HEADER"
50+
echo "You can also run: just check-license-headers to verify your changes."
51+
exit 1
52+
else
53+
echo "All Rust files have the required license header"
54+
exit 0
55+
fi

src/hyperlight-js-runtime/build.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
fn main() {
217
if std::env::var_os("CARGO_CFG_HYPERLIGHT").is_none() {
318
return;

src/hyperlight-js-runtime/src/globals/console.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use rquickjs::object::Property;
217
use rquickjs::{Ctx, Module, Object};
318

src/hyperlight-js-runtime/src/globals/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use rquickjs::Ctx;
217

318
mod console;

src/hyperlight-js-runtime/src/globals/print.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use rquickjs::object::Property;
217
use rquickjs::{Ctx, Function, Module, Object};
318

src/hyperlight-js-runtime/src/globals/require.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use rquickjs::object::Property;
217
use rquickjs::{Ctx, Function, Module, Object};
318

src/hyperlight-js-runtime/src/globals/string.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use alloc::string::{String, ToString as _};
217

318
use base64::engine::general_purpose::STANDARD_NO_PAD;

src/hyperlight-js-runtime/src/host.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2026 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116
use alloc::string::String;
217

318
use anyhow::Result;

0 commit comments

Comments
 (0)