Skip to content

Add Apache 2.0 licensing and enforce SPDX headers - #3

Open
vvoland wants to merge 3 commits into
moby:masterfrom
vvoland:add-license
Open

vvoland wants to merge 3 commits into
moby:masterfrom
vvoland:add-license

Conversation

@vvoland

@vvoland vvoland commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

@vvoland
vvoland requested a review from thaJeztah September 16, 2026 18:42
@vvoland vvoland mentioned this pull request Sep 16, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thx! left a comment 😅

Comment thread client/client.go
Comment on lines +1 to +2
// SPDX-License-Identifier: Apache-2.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This also needs a copyright; we can use the same as we did for moby/profiles;

// SPDX-FileCopyrightText: Copyright The Moby Authors
// SPDX-License-Identifier: Apache-2.0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah good point, done

Comment thread hack/lint-license.sh
Comment on lines +6 to +18
cd "$(dirname "${BASH_SOURCE[0]}")/.."

# Check tracked sources only; vendored code keeps its upstream licensing.
git ls-files -z -- '*.go' '*.sh' '*.proto' ':!:vendor/**' | (
status=0
while IFS= read -r -d '' path; do
if ! sed -n '1,5p' "$path" | grep -Eq '^(//|#) SPDX-License-Identifier: Apache-2\.0[[:space:]]*$'; then
printf '%s: missing Apache-2.0 SPDX header in the first five lines\n' "$path" >&2
status=1
fi
done
exit "$status"
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, we could use the go-header linter for this; https://golangci-lint.run/docs/linters/configuration/#goheader

But not sure if it also handles non-Go files, so alternatively https://github.com/containerd/ltag our https://github.com/google/addlicense

Not really a concern right now, but if we'd ever fork code from other modules (or, e.g. from stdlib), we can't assume all files to have Apache 2.0.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We can change that later 😅

Signed-off-by: Paweł Gronowski <git@grono.dev>
Signed-off-by: Paweł Gronowski <git@grono.dev>
Signed-off-by: Paweł Gronowski <git@grono.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add a License

2 participants