From 216c04cd22cedaab8cff577692d90e6ff7a1af0b Mon Sep 17 00:00:00 2001 From: Brandon Mitchell Date: Sat, 27 Jun 2026 10:51:43 -0400 Subject: [PATCH] OCI copyright headers This aligns with the TOB guidelines Signed-off-by: Brandon Mitchell --- .github/workflows/build.yml | 1 + .tool/check-license | 30 ++++++++++++++++++++++++++++++ .tool/genheader.go | 2 +- Makefile | 7 ++++++- conformance/Dockerfile | 14 ++++++++++++++ conformance/api.go | 14 ++++++++++++++ conformance/config.go | 14 ++++++++++++++ conformance/errors.go | 14 ++++++++++++++ conformance/junit.go | 14 ++++++++++++++ conformance/legacy_test.go | 14 ++++++++++++++ conformance/main.go | 14 ++++++++++++++ conformance/results.go | 14 ++++++++++++++ conformance/run.go | 14 ++++++++++++++ conformance/state.go | 14 ++++++++++++++ conformance/testdata.go | 14 ++++++++++++++ specs-go/v1/error.go | 2 +- specs-go/v1/extensions/ext.go | 2 +- specs-go/v1/repository.go | 2 +- specs-go/v1/tags.go | 2 +- specs-go/version.go | 2 +- 20 files changed, 197 insertions(+), 7 deletions(-) create mode 100755 .tool/check-license diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07681bc8..75a8f091 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: export PATH="$(go env GOPATH)/bin:${PATH}" make install.tools make .gitvalidation + make check-license make docs conformance set +e diff --git a/.tool/check-license b/.tool/check-license new file mode 100755 index 00000000..2f4d88b0 --- /dev/null +++ b/.tool/check-license @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Copyright the Open Container Initiative Contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +ret=0 + +for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do + if ! head -n3 "${file}" | grep -Eq "(Copyright the Open Container Initiative Contributors|generated|GENERATED)"; then + echo "${file}:missing license header" + ret=1 + fi +done + +exit $ret diff --git a/.tool/genheader.go b/.tool/genheader.go index 5b89e97d..73b6e675 100644 --- a/.tool/genheader.go +++ b/.tool/genheader.go @@ -1,4 +1,4 @@ -// Copyright 2018 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 1d71d3cf..4eb0a185 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ endif DOC_FILES := spec.md FIGURE_FILES := -test: .gitvalidation +test: .gitvalidation check-license # When this is running in GitHub, it will only check the GitHub commit range .gitvalidation: @@ -82,6 +82,11 @@ install.tools: .install.gitvalidation .install.gitvalidation: go install github.com/vbatts/git-validation@latest +.PHONY: check-license +check-license: ## check license headers in source files + @echo "checking license headers" + @./.tool/check-license + conformance: conformance-test conformance-cmd conformance-test: diff --git a/conformance/Dockerfile b/conformance/Dockerfile index 23bf1dfe..5e66196f 100644 --- a/conformance/Dockerfile +++ b/conformance/Dockerfile @@ -1,3 +1,17 @@ +# Copyright the Open Container Initiative Contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM golang:1.24-alpine AS build COPY . . diff --git a/conformance/api.go b/conformance/api.go index 049e8214..76439be7 100644 --- a/conformance/api.go +++ b/conformance/api.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/config.go b/conformance/config.go index 28946f60..a8ff60d4 100644 --- a/conformance/config.go +++ b/conformance/config.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/errors.go b/conformance/errors.go index 3cb0b4b6..1ea15385 100644 --- a/conformance/errors.go +++ b/conformance/errors.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import "errors" diff --git a/conformance/junit.go b/conformance/junit.go index de385b07..e6d115be 100644 --- a/conformance/junit.go +++ b/conformance/junit.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import "encoding/xml" diff --git a/conformance/legacy_test.go b/conformance/legacy_test.go index ca610e99..47dda806 100644 --- a/conformance/legacy_test.go +++ b/conformance/legacy_test.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build legacy || !unit_tests package main diff --git a/conformance/main.go b/conformance/main.go index e6a66f3e..ce6ce496 100644 --- a/conformance/main.go +++ b/conformance/main.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/results.go b/conformance/results.go index 560dcd97..4440c64a 100644 --- a/conformance/results.go +++ b/conformance/results.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/run.go b/conformance/run.go index 5ce662c3..65039529 100644 --- a/conformance/run.go +++ b/conformance/run.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/state.go b/conformance/state.go index 4e05940f..9e5f7934 100644 --- a/conformance/state.go +++ b/conformance/state.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/conformance/testdata.go b/conformance/testdata.go index 2a99487c..04041264 100644 --- a/conformance/testdata.go +++ b/conformance/testdata.go @@ -1,3 +1,17 @@ +// Copyright the Open Container Initiative Contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/specs-go/v1/error.go b/specs-go/v1/error.go index 2be9162f..ee40c421 100644 --- a/specs-go/v1/error.go +++ b/specs-go/v1/error.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/specs-go/v1/extensions/ext.go b/specs-go/v1/extensions/ext.go index 5c3d7367..4a13a3a2 100644 --- a/specs-go/v1/extensions/ext.go +++ b/specs-go/v1/extensions/ext.go @@ -1,4 +1,4 @@ -// Copyright 2022 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/specs-go/v1/repository.go b/specs-go/v1/repository.go index 5dae5707..661f1202 100644 --- a/specs-go/v1/repository.go +++ b/specs-go/v1/repository.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/specs-go/v1/tags.go b/specs-go/v1/tags.go index 268e726e..7b4b0664 100644 --- a/specs-go/v1/tags.go +++ b/specs-go/v1/tags.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/specs-go/version.go b/specs-go/version.go index 8364ab18..f6ef0a2a 100644 --- a/specs-go/version.go +++ b/specs-go/version.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Linux Foundation +// Copyright the Open Container Initiative Contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.