Skip to content

chore(licenses): move api package to SPDX license headers - #20979

Merged
david-allison merged 3 commits into
ankidroid:mainfrom
david-allison:spdx
May 8, 2026
Merged

chore(licenses): move api package to SPDX license headers #20979
david-allison merged 3 commits into
ankidroid:mainfrom
david-allison:spdx

Conversation

@david-allison

@david-allison david-allison commented May 7, 2026

Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Opus 4.7 - wording + code + tests

Purpose / Description

SPDX is a modern alternative to the full GPL header. In use by the Linux kernel.

SPDX headers are advantageous, as they reduce line noise, makes reviews easier, and makes it impossible for someone to accidentally use GPL-3.0-only, or GPL-3.0-or-later in the API.

I selected the API module for a sample as it's LGPL and limited in scope.

Fixes

Approach

brew install reuse
reuse download GPL-3.0-or-later
reuse download LGPL-3.0-or-later
  • Add lint
  • Manually fixup API files

Note: // SPDX-FileCopyrightText: allows dropping the Copyright (c), but I retain the full copyright declarations for existing contributors. The upsides of a few characters aren't worth the downsides

How Has This Been Tested?

Unit tested

Screenshot 2026-05-07 at 16 34 36

Learning (optional, can help others)

https://reuse.software/tutorial/
https://www.kernel.org/doc/html/v5.7/process/license-rules.html
https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

SPDX is a modern alternative to the full GPL header used by the kernel.

This allows us to move to `// SPDX-License-Identifier: GPL-3.0-or-later`
in a compliant manner.

```
brew install reuse
reuse download GPL-3.0-or-later
reuse download LGPL-3.0-or-later
```

SPDX headers are advantageous, as they reduce line noise, makes
reviews easier, and makes it impossible for someone to accidentally
use `GPL-3.0-only`.

https://reuse.software/tutorial/
https://www.kernel.org/doc/html/v5.7/process/license-rules.html
https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions

Issue 20954
SPDX is a modern alternative to the full GPL header used by the kernel.

https://reuse.software/tutorial/
https://www.kernel.org/doc/html/v5.7/process/license-rules.html
https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions

```
// SPDX-FileCopyrightText: 2025 David Allison <david@example.com>
// SPDX-License-Identifier: GPL-3.0-or-later
```

Note: `// SPDX-FileCopyrightText:` allows dropping the `Copyright (c)`
but we retain the full copyright declarations for existing contributors.

This significantly cuts down on 'lines changed' in the codebase

Mono-licensed files only for simplicity, but we the restriction should
be relaxed to allow for mixed licenses once discussed.

Issue 20954

Assisted-by: Claude Opus 4.7
SPDX headers are advantageous, as they reduce line noise, makes
reviews easier, and makes it impossible for someone to accidentally
use `GPL-3.0-only`.

The API is LGPL, so this makes it a good place to start

https://reuse.software/tutorial/
https://www.kernel.org/doc/html/v5.7/process/license-rules.html
https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions

Issue 20954
@BrayanDSO BrayanDSO added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels May 7, 2026
@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels May 8, 2026
@lukstbit
lukstbit added this pull request to the merge queue May 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 8, 2026
@david-allison
david-allison added this pull request to the merge queue May 8, 2026
Merged via the queue into ankidroid:main with commit a0b0d32 May 8, 2026
19 checks passed
@github-actions github-actions Bot added this to the 2.25 release milestone May 8, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label May 8, 2026
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.

3 participants