feat: tool/copyright - #4983
Conversation
Checks the claims in the headers against git history and reports any organization with no contribution behind it. -w removes them. Needs -dates, and skips a file when a contributor's affiliation is unknown.
|
Is there a documentation of what is required? The additional copyright information seems to be just a duplicate? The individual authors with date can be derived from the commit history. Separately, how about adopting the REUSE recommendation with SPDX identifier: |
Yes, I'm all for it! I think a short: // SPDX-License-Identifier: Apache-2.0is better than the entire license boilerplate we have right now in each file: // 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.But I wanted to keep it out of this PR. This change would belong to another PR. |
Legally speaking, this PR changes nothing and is not supposed to change anything about licenses and copyright claims. It only adds a new tool that can help automate bumping/updating the copyright claims we have right now. I can just run The history-rewrite functionality that it provides is not used in this PR yet. We may or may not use it to clean up the entire codebase in a later PR. Changing the way we do copyright claims, attributions and license disclosure is not in the scope of this PR. |
|
So what do these scripts actually do? To me the example looked like they added author email, date, and commit hash to the copyright? If they do something else then I misunderstood what the scripts are meant to do... |
No. Nothing changes in that regard.
If I change a bunch of files and I'm listed under affiliations.json: {
"name": "Roman Sharkov",
"emails": ["roman.scharkov@gmail.com", "rsc@scion.org"],
"affiliation": "SCION Association"
}then:
// Copyright 2026 SCION Association
What it also can do is rewrite claims in a sub-tree of the repository with: make copyright-update COPYRIGHT_FLAGS="-history $PWD/tools/copyright/affiliation-history.json"
|
A task I long wanted to automate, assisted with Claude Code (Opus 5)
It makes copyright claims easier to maintain.
This PR does not change any copyright claims, it only begins to enforce them starting with
attributions.jsonsince2026-09-01. I kept history changes out of this PR to avoid blowing the scope. We can do a general cleanup in a later PR.Adds
make copyright-checkandmake copyright-update:user.emailcopyright-update, making it harder to miss.Alternatives Analysis
I haven't found an off the shelf tool that does what we need.
DISCLAIMER: I did use Claude Code (Opus 5) to generate this table so keep in mind that there can be mistakes even though I tried to check some of them manually:
tools/copyrightREUSE.tomlUpdateCopyrightsActioncopyright.py.golangci.yml)