Skip to content

contributing: Use SPDX copyright tags in unlabeled file headers - #7756

Merged
wenzeslaus merged 1 commit into
OSGeo:mainfrom
wenzeslaus:spdx-bare-notices
Sep 4, 2026
Merged

wenzeslaus merged 1 commit into
OSGeo:mainfrom
wenzeslaus:spdx-bare-notices

Conversation

@wenzeslaus

@wenzeslaus wenzeslaus commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Converts the 1032 files whose copyright notice does not use the labeled COPYRIGHT field: Doxygen file blocks in the C libraries, Python module docstrings in the GUI and the Python packages, and assorted headers. Together with #7743 this covers the whole tree apart from vendored code and the cases listed below.

  • Years and names preserved as is; the collective line and the license identifier follow the same rules as contributing: Use SPDX copyright tags in file headers #7743.
  • Vendored code excluded by directory and by the holder named in the notice.
  • Translation catalogs under locale excluded as a standing decision.
  • Multi-holder notices and notices whose license text is separated from them by an author list are left for reviewed one-off replacements in a follow-up.

A typical replacement:

  *
  * Dynamic balanced k-d tree implementation
  *
- * (C) 2014 by the GRASS Development Team
- *
- * This program is free software under the GNU General Public License
- * (>=v2).  Read the file COPYING that comes with GRASS for details.
+ * SPDX-FileCopyrightText: 2014 GRASS Development Team
+ * SPDX-License-Identifier: GPL-2.0-or-later
  *
  * \author Markus Metz

The policy decisions were made during GRASS Community Meeting 2026 in San Michele all'Adige.

Like #7743, this should technically merge after #7749, which defines the "GRASS Development Team" line, but it does not have to.

The conversion was performed by a deterministic script, not by a language model. The script was extended for this corpus and this description drafted with AI assistance (Claude Code with Opus 4.8 and Fable 5); the decisions are the author's.

Details: scope, rules, decisions, deferred cases, and how it was checked (AI generated)

Decisions beyond #7743

  • Files whose notice carries no license text at all get the identifier when the notice is team-held, covered by the repository-wide grant in COPYING, or when all its years fall in the CERL era, in or before 1992. Individual-held notices from 1993 on with no license text are left alone and reported.
  • The locale/po exclusion is a standing decision: the gettext headers already state the license, distributed under the same license as the GRASS package, and they are rewritten by the translation platform sync, so an edit there would not survive.
  • Some headers spell the license paragraph as Licence:-labeled text (imagery testsuites) or mark it with a Doxygen \copyright tag (lib/rst); both are recognized as the same GPL paragraph and converted.

Scope

files
converted 1032
ambiguous holders, follow-up 62
license text separated by an author list, follow-up 54
locale/po catalogs, standing exclusion 85
vendored by path or holder 211
individual holder, 1993 or later, no license text 7
not a notice, not UTF-8, no anchor, lint-conflicted, or audit-deferred 14
baseline: files with a notice and no COPYRIGHT field 1465

Rules

Same as #7743: one holder per SPDX-FileCopyrightText line, named holders first, the collective line last, the identifier after all copyright lines, years and names verbatim, the collective line carries years only where it is the sole copyright line, and neither AUTHOR(S) nor the git history was consulted. Author tags (\author, @author) and all other header text outside the notice and license paragraph are untouched. Files half-converted earlier, carrying an identifier but a legacy notice, are completed without duplicating the identifier.

Checked

Every added line is one of the two SPDX shapes and every removed line is a known notice or license-paragraph form (2250 added, 4659 removed, none unclassifiable). No byte outside the replaced span changed, trailing bytes are identical, the four-digit years on notice lines are conserved exactly, no emitted C line exceeds 78 columns, and a second run converts nothing. pre-commit over all 1032 files passes with nothing reformatted. All C compiles; all 400 converted Python files parse. 43 tests cover the script, including the wrapped-holder, \copyright-tag, and interposed-author-list cases.

One file, man/build_check.py, is deferred because the pinned ruff hook rewrites it on the unmodified base already, so converting it would pull an unrelated lint fix into the diff.

The script (spdx_headers.py.txt), its tests (spdx_headers_test.py.txt), and the full deferred report (deferred-bare.md) are attached.

deferred-bare.md
spdx_headers_test.py.txt
deferred-cases.md

@github-actions github-actions Bot added windows Microsoft Windows specific GUI wxGUI related macOS macOS specific vector Related to vector data processing raster Related to raster data processing temporal Related to temporal data processing Python Related code is in Python C Related code is in C database Related to database management libraries module docs general display imagery tests Related to Test Suite raster3d misc labels Jul 18, 2026
Comment thread gui/xml/grass-interface.dtd Resolved
Comment thread gui/wxpython/wxgui.py Resolved
Comment thread imagery/i.pca/testsuite/test_pca.py Resolved
Comment thread imagery/i.segment/ngbrtree.c Resolved
Comment thread include/grass/ogsf.h Resolved
Comment thread lib/btree2/rbtree.c Resolved
@cwhite911

cwhite911 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

@wenzeslaus overall, the conversion worked well but I found a few examples that were not properly picked up.

I didn't comment on every instance where I found an issue, but if you look at the comments they should capture the 3-4 variants that need to be addressed.

I'm on my phone otherwise I would have added the patterns myself here.

Some of these may have been picked up in the other PRs.

@wenzeslaus

Copy link
Copy Markdown
Member Author

Extracting the authors when they are not in the copyright line is out of scope. I will update from main and then this will be ready for review.

@wenzeslaus
wenzeslaus force-pushed the spdx-bare-notices branch 2 times, most recently from 870e0ee to bb72865 Compare August 24, 2026 18:09
Convert the 1032 files whose copyright notice does not use the labeled
COPYRIGHT field: Doxygen file blocks in the C libraries, Python module
docstrings in the GUI and the Python packages, and assorted headers.
Names and years stay verbatim; each holder gets its own line; the
collective line and the license identifier follow the same rules as the
earlier conversions.

Files whose notice carries no license text at all get the identifier
when the notice is team-held, covered by the repository-wide grant in
COPYING, or when all its years fall in the CERL era, in or before 1992.
Individual-held notices from 1993 on with no license text are left
alone and reported.

Vendored code is excluded by directory and by the holder named in the
notice. Translation catalogs under locale are excluded as a standing
decision: their gettext headers already state the license and are
rewritten by the translation platform sync. Notices naming several
holders, and notices whose license text is separated from them by an
author list, are left for reviewed one-off replacements in a follow-up.
One file the pinned ruff hook rewrites on the unmodified base is left
out so that an unrelated lint fix does not ride along.

Files half-converted earlier, carrying an identifier but a legacy
notice, are completed without duplicating the identifier.

The conversion was performed by a deterministic script, not by a
language model. The script and its report are attached to the pull
request. The script was extended for this corpus with AI assistance
(Claude Code with Opus 4.8 and Fable 5); the decisions are the
author's.

@nilason nilason left a comment

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.

Thanks!

@wenzeslaus
wenzeslaus enabled auto-merge (squash) September 4, 2026 02:01
@wenzeslaus
wenzeslaus dismissed cwhite911’s stale review September 4, 2026 02:11

Addressed in comments (mostly as out of scope). Approved by @nilason.

@wenzeslaus
wenzeslaus merged commit 985dd24 into OSGeo:main Sep 4, 2026
26 of 29 checks passed
@wenzeslaus
wenzeslaus deleted the spdx-bare-notices branch September 4, 2026 02:11
@github-actions github-actions Bot added this to the 8.6.0 milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C database Related to database management display docs general GUI wxGUI related imagery libraries macOS macOS specific misc module Python Related code is in Python raster Related to raster data processing raster3d temporal Related to temporal data processing tests Related to Test Suite vector Related to vector data processing windows Microsoft Windows specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants