Skip to content

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

Open
wenzeslaus wants to merge 1 commit into
OSGeo:mainfrom
wenzeslaus:spdx-bare-notices
Open

contributing: Use SPDX copyright tags in unlabeled file headers#7756
wenzeslaus wants to merge 1 commit into
OSGeo:mainfrom
wenzeslaus:spdx-bare-notices

Conversation

@wenzeslaus

@wenzeslaus wenzeslaus commented Jul 17, 2026

Copy link
Copy Markdown
Member

Converts the 1030 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 Other GRASS authors
+ * 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 "Other GRASS authors", 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 1030
ambiguous holders, follow-up 63
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, or lint-conflicted 12
baseline: files with a notice and no COPYRIGHT field 1462

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 (2246 added, 4649 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 1030 files passes with nothing reformatted. All C compiles; all 399 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

Convert the 1030 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.
@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
Copyright (C) 2000-2007 by the GRASS Development Team
SPDX-FileCopyrightText: 2000-2007 Other GRASS authors
SPDX-License-Identifier: GPL-2.0-or-later
Author: Jan-Oliver Wagner <jan intevation.de>

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.

Misses author

Comment thread gui/wxpython/wxgui.py
Comment on lines 12 to 13
@author Michael Barton (Arizona State University)
@author Jachym Cepicky (Mendel University of Agriculture)

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.

Should these authors be picked up?

@@ -3,10 +3,9 @@
Purpose: Tests i.pca.

Author: Hamed Elgizery - hamedashraf2004@gmail.com

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.

Here is an example of the author getting picked up by the script.

Comment on lines 11 to 12
* \author Original author Julienne Walker 2003, 2008
* GRASS implementation Markus Metz, 2009

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.

Missed authors.

Comment thread include/grass/ogsf.h
@@ -11,7 +11,8 @@
\author Thematic mapping enabled by Martin Landa <landa.martin gmail.com)

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.

Another type of missed author

Comment thread lib/btree2/rbtree.c
Comment on lines 11 to 12
* \author Original author Julienne Walker 2003, 2008
* GRASS implementation Markus Metz, 2009

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.

Missed authors

@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.

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.

2 participants