Workbench
Workbench copied to clipboard
Make licensing of code snippets clearer with REUSE
The code snippets in Workbench are licensed as CC0-1.0, which is great. It would be good if that were made clearer in the Workbench UI, though, both so that
- people know they can copy the code out of Workbench and use it anywhere/anyhow, and to
- provide an introduction to source code licensing, as it is an important part of what makes FOSS what it is.
I suggest this could be implemented fairly unintrusively by putting a REUSE header at the top of each code file. See https://reuse.software/faq/
This would probably look like:
// SPDX-License-Identifier: CC0-1.0
on the first line of each snippet file.
REUSE compliance can be tested using the reuse command line tool. Porting an entire codebase to be compliant overnight is hard. In GLib, we’re approaching it by using CI to test that the compliance level never decreases.
I decided against a spdx reuse header because I'm trying to expose newcomers to as little jargon as possible.
If you don't know what you're looking at; // SPDX-License-Identifier: CC0-1.0 looks really alien.
I agree we should make it clearer. We could do that by not having to scroll all the way down to learn that all examples can be reused freely.
I'm trying to expose newcomers to as little jargon as possible.
I can understand that.
One strawman option which comes to mind is to explicitly introduce the user to licensing issues after they’ve used Workbench a few times. By that point they are likely copying code out of it quite a lot, and probably don’t have so much mental burden that they have capacity to learn about copyright.
So, something like after they’ve opened Workbench for the 10th time, it would display a dialog with a basic introduction to licensing/copyright and why it’s really important for FOSS, and it would add the SPDX comments to the top of examples from that time onwards.
Ok so the objective is to teach users about copyright and FLOSS. Triggering stuff without user interaction is generally discouraged.
We could have a "Misc" section with some documentation about copyright, FLOSS, GNOME, community, … I have a toy Markdown GTK renderer for more textual/tutorial-style Library entry, but it's not ready.
We could also link to a good source of information about it somewhere in the Library window or Workbench menu.
I guess there are several objectives here, which could be split out into separate issues if you think that would be better:
- Teach users about licensing/copyright and how it’s integral to FOSS
- In particular, now that I think about it, Workbench is slightly conditioning users to be OK with copying code to their projects without considering the license it’s under. While that’s absolutely fine (and as intended) for CC0 licensed code, it’s not great for copyleft licenses.
- Make Workbench itself (including, but not limited to) its example code files, REUSE-compliant. For the example files, if you don’t want to put the SPDX header in a comment at the top of them, a dep5 file can be used instead.
It might be worth asking if SPDX headers are something developers can expect to see everywhere nowadays (the giant GPL abstract seems to be going out of fashion, thankfully).
That being said, the Icon Library app handles this in the "export" window, although that might not apply to the current/desired UX for Workbench: