Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,8 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
with:
cache: true
- name: Check SPDX license headers
run: |
missing=()
while IFS= read -r file; do
if ! grep -q "SPDX-License-Identifier" "$file"; then
missing+=("$file")
fi
done < <(git ls-files -- '*.ts' '*.tsx' '*.rs' '*.proto' '*.css')

if [[ ${#missing[@]} -gt 0 ]]; then
echo "The following files are missing an SPDX license header:"
printf ' %s\n' "${missing[@]}"
echo ""
echo "Add the following header to the top of each file:"
echo " // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved."
echo " // SPDX-License-Identifier: Apache-2.0"
exit 1
fi

echo "All $(git ls-files -- '*.ts' '*.tsx' '*.rs' '*.proto' '*.css' | wc -l | tr -d ' ') files have SPDX license headers."
run: pixi run pre-commit run verify-copyright --all-files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complains about a misplaced comma in some files, otherwise looking great --> 2026, NVIDIA vs 2026 NVIDIA

-// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES.
All rights reserved.
+// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
All rights reserved.

38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# License-header enforcement via pre-commit + rapidsai/pre-commit-hooks.
#
# Install locally with:
# pixi run pre-commit install
#
# Run on all files (bulk update):
# pixi run pre-commit run verify-copyright --all-files

exclude: |
(?x)
^target/
^ui/node_modules/
^ui/.pnpm-store/
^docs/

repos:

# Insert/maintain the NVIDIA SPDX header. --spdx emits the two-line
# SPDX-FileCopyrightText / SPDX-License-Identifier block; the year range is
# derived from git history and auto-bumped on edit.
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v1.5.1
hooks:
- id: verify-copyright
args: [--fix, --spdx]
exclude: |
(?x)
bridge/include/rust/cxx\.h$|
bridge/include/quent-bridge/gen/|
examples/simulator/server/ts-bindings/
# When adding a new source file type to the repo, add its extension here.
files: |
(?x)
CMakeLists\.txt$|
[.](rs|js|ts|tsx|jsx|mjs|cjs|py|sh|cpp|h|proto|css)$
Loading
Loading