[gjs: 15/18] doc: Update style guide to include SPDX comments




commit f30f4b76bd9f8844ef6e2fad98075ca661ee2e4d
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Nov 30 15:46:07 2020 -0800

    doc: Update style guide to include SPDX comments
    
    Change the example to not put the license inline, and link to the REUSE
    specification.

 doc/CPP_Style_Guide.md | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)
---
diff --git a/doc/CPP_Style_Guide.md b/doc/CPP_Style_Guide.md
index beac17d5..9c2e33ad 100644
--- a/doc/CPP_Style_Guide.md
+++ b/doc/CPP_Style_Guide.md
@@ -122,34 +122,14 @@ The standard header looks like this:
 
 ```c++
 /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-/*
- * Copyright (c) YEARS  NAME <EMAIL>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
+// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
+// SPDX-FileCopyrightText: YEAR NAME <EMAIL>
 
 #include <HEADERS>
 
-/* gi/private.cpp - private "imports._gi" module with operations that we need
- * to use from JS in order to create GObject classes, but should not be exposed
- * to client code.
- */
+// gi/private.cpp - private "imports._gi" module with operations that we need
+// to use from JS in order to create GObject classes, but should not be exposed
+// to client code.
 ```
 
 A few things to note about this particular format: The "`-*-`" string on
@@ -158,8 +138,8 @@ file, not a C file (since C++ and C headers both share the `.h`
 extension.)
 This is originally an Emacs convention, but other editors use it too.
 
-The next section in the file is a concise note that describes the file's
-copyright and the license that the file is released under.
+The next lines in the file are machine-readable SPDX comments describing the file's copyright and the 
license that the file is released under.
+These comments should follow the [REUSE specification][reuse].
 This makes it perfectly clear what terms the source code can be
 distributed under and should not be modified.
 Names can be added to the copyright when making a substantial
@@ -171,6 +151,8 @@ If an algorithm is being implemented or something tricky is going on,
 this should be explained here, as well as any notes or *gotchas* in the
 code to watch out for.
 
+[reuse]: https://reuse.software/
+
 ##### Class overviews ######
 
 Classes are one fundamental part of a good object oriented design.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]