Skip to content

contributing: Define the SPDX copyright header convention - #7749

Merged
wenzeslaus merged 8 commits into
OSGeo:mainfrom
wenzeslaus:spdx-convention
Sep 23, 2026
Merged

wenzeslaus merged 8 commits into
OSGeo:mainfrom
wenzeslaus:spdx-convention

Conversation

@wenzeslaus

@wenzeslaus wenzeslaus commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Defines the SPDX copyright header convention that #7743 applies to most of the source files.

The "collective" author is unchanged, i.e., the GRASS Development Team, which COPYING already names; COPYING itself is unchanged.

The decision to use SPDX was made during GRASS Community Meeting 2026 in San Michele all'Adige.

Written with AI assistance (Claude Code with Opus 4.8 and Fable 5), especially the tests.

Details (mostly AI generated)

The files that specify a header

These were left out of #7743 because each states what a header should look like rather than merely carrying one, so they need reading rather than converting, and two of them generate headers into new files.

  • COPYING is not modified. The style guide refers to its existing statement that GRASS is copyright by members of the GRASS Development Team.
  • doc/development/style_guide.md converts all three templates, Python, wxGUI docstring and C, and states the rules the templates cannot show: who adds a line, when, and that other people's lines are left alone. The wxGUI template is team-only, so its collective keeps the year; the other two name a holder, so their collective is bare.
  • lib/gis/parser_script.c replaces ten fprintf calls emitting the GPL paragraph with three SPDX lines. GRASS_VERSION_DATE is a bare year, so it feeds SPDX-FileCopyrightText unchanged. Its own header is converted too.
  • general/g.parser/g.parser.md and .html update the sample output in the same commit as the code, so the documentation never shows a header the tool cannot produce. Nothing tests this, so it holds by review rather than automatically.
  • utils/copywrite.pl is removed. Nothing references it, it shells out to cvs2cl.pl which is not in the repository and which reads CVS history that no longer exists, and it hardcodes launching xemacs.

The test

general/g.parser/tests/g_parser_script_test.py checks the generated script for the SPDX lines and (the lack of) COPYRIGHT field or GPL prose, and that each copyright line names one holder with the collective last.

@github-actions github-actions Bot added Python Related code is in Python C Related code is in C HTML Related code is in HTML libraries module docs markdown Related to markdown, markdown files general tests Related to Test Suite labels Jul 17, 2026

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

Overall, looks good I just had a few clarifying questions that I don't know if they are correct or not.

Comment thread lib/gis/parser_script.c Resolved
Comment thread COPYING Resolved
Comment thread general/g.parser/g.parser.html Resolved
cwhite911
cwhite911 previously approved these changes Jul 20, 2026
Comment thread COPYING Resolved
Comment thread doc/development/style_guide.md Resolved
Source file copyright notices are moving to SPDX tags, where the
collective holder is spelled "Other GRASS authors". Define it, so that the
files carrying it point at something.

The definition is by authorship rather than by membership of a body: the
authors of a file who are not named individually in it. COPYING already
opens by saying GRASS is copyright by members of the GRASS Development
Team, so the new text does not restate it.

The wording avoids quotation marks and apostrophes deliberately. COPYING is
wrapped line by line into C string literals by include/CMakeLists.txt and
include/grass/Makefile, neither of which escapes anything, and the file has
never contained either character.
Commit 0211182 replaced the GPL prose in these templates with an
SPDX-License-Identifier line and left the COPYRIGHT field alone. Finish
that move: replace the field with SPDX-FileCopyrightText lines so the
whole notice is machine readable.

One holder per line, named holders first, the collective line last, and
the license identifier after all copyright lines. COPYING defines the
collective. State the rules next to the template, since the templates
alone do not say who adds a line or when.

Drafted with AI assistance (Claude Opus 4.8); the decisions are the
author's.
Scripts generated by --script carried a COPYRIGHT field and the full GPL
paragraph. Emit SPDX tags instead, matching the style guide templates, so
that generated scripts start out in the form the project documents.

GRASS_VERSION_DATE is a bare year, so it feeds SPDX-FileCopyrightText
unchanged.

Update the sample output in both g.parser.md and g.parser.html in the same
commit, so the documentation never shows a header the tool cannot produce.

Convert this file's own header as well: a generator that emits SPDX tags
while carrying a legacy notice contradicts itself. The remaining files
using the bare (C) notice form are out of scope here.

Drafted with AI assistance (Claude Opus 4.8); the decisions are the
author's.
Check the properties the header has to hold to rather than its exact text:
that no COPYRIGHT field or GPL paragraph survives in the generated script,
and that each copyright line names one holder with the collective line last.

Comparing against a copy of the template would only restate what
parser_script.c already defines, and would need updating whenever that file
changes, so it would report edits rather than find faults.

Written with AI assistance (Claude Opus 4.8); the decisions are the
author's.
The script is unreferenced, and it cannot run: it shells out to cvs2cl.pl,
which is not in the repository and which reads CVS history that no longer
exists, and it hardcodes launching xemacs.

It also embeds a third header template, which would otherwise have to be
kept in sync with the style guide and with g.parser --script. Its method,
deriving copyright holders by parsing commit history, is not one the
project wants to carry forward.

Removing the file does not strip a copyright notice from any surviving
file, and its authorship remains in the history.
…line

Replace "Other GRASS authors" with "GRASS Development Team", the name the
notices used before, so the collective line keeps the established holder
name rather than introducing a new term. COPYING keeps defining what the
line stands for.
…he project

The paragraph added to COPYING defined GRASS Development Team as the
authors of a file who are not named individually, which reads as
changing what the existing copyright holder means. COPYING already
states that GRASS is copyright by members of the GRASS Development
Team, so drop the addition and let the style guide point to that.
@wenzeslaus
wenzeslaus merged commit ef4b87c into OSGeo:main Sep 23, 2026
27 of 28 checks passed
@wenzeslaus
wenzeslaus deleted the spdx-convention branch September 23, 2026 15:14
@github-actions github-actions Bot added this to the 8.6.0 milestone Sep 23, 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 docs general HTML Related code is in HTML libraries markdown Related to markdown, markdown files module Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants