[PATCH] docs: sphinx: add missing SPDX tags

Mauro Carvalho Chehab posted 1 patch 5 months, 4 weeks ago
Documentation/sphinx/cdomain.py           | 1 +
Documentation/sphinx/kernel_include.py    | 1 +
Documentation/sphinx/kerneldoc.py         | 1 +
Documentation/sphinx/kfigure.py           | 1 +
Documentation/sphinx/load_config.py       | 1 +
Documentation/sphinx/min_requirements.txt | 1 +
Documentation/sphinx/parse-headers.pl     | 5 ++++-
Documentation/sphinx/requirements.txt     | 1 +
Documentation/sphinx/rstFlatTable.py      | 1 +
9 files changed, 12 insertions(+), 1 deletion(-)
[PATCH] docs: sphinx: add missing SPDX tags
Posted by Mauro Carvalho Chehab 5 months, 4 weeks ago
Several Sphinx extensions and tools are missing SPDX tags.
Add them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/sphinx/cdomain.py           | 1 +
 Documentation/sphinx/kernel_include.py    | 1 +
 Documentation/sphinx/kerneldoc.py         | 1 +
 Documentation/sphinx/kfigure.py           | 1 +
 Documentation/sphinx/load_config.py       | 1 +
 Documentation/sphinx/min_requirements.txt | 1 +
 Documentation/sphinx/parse-headers.pl     | 5 ++++-
 Documentation/sphinx/requirements.txt     | 1 +
 Documentation/sphinx/rstFlatTable.py      | 1 +
 9 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
index e8ea80d4324c..3dc285dc70f5 100644
--- a/Documentation/sphinx/cdomain.py
+++ b/Documentation/sphinx/cdomain.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8; mode: python -*-
+# SPDX-License-Identifier: GPL-2.0
 # pylint: disable=W0141,C0113,C0103,C0325
 """
     cdomain
diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
index 8db176045bc5..1e566e87ebcd 100755
--- a/Documentation/sphinx/kernel_include.py
+++ b/Documentation/sphinx/kernel_include.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8; mode: python -*-
+# SPDX-License-Identifier: GPL-2.0
 # pylint: disable=R0903, C0330, R0914, R0912, E0401
 
 """
diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
index b818d4c77924..51a2793dc8e2 100644
--- a/Documentation/sphinx/kerneldoc.py
+++ b/Documentation/sphinx/kerneldoc.py
@@ -1,4 +1,5 @@
 # coding=utf-8
+# SPDX-License-Identifier: MIT
 #
 # Copyright © 2016 Intel Corporation
 #
diff --git a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
index f1a7f13c9c60..ad495c0da270 100644
--- a/Documentation/sphinx/kfigure.py
+++ b/Documentation/sphinx/kfigure.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8; mode: python -*-
+# SPDX-License-Identifier: GPL-2.0
 # pylint: disable=C0103, R0903, R0912, R0915
 """
     scalable figure and image handling
diff --git a/Documentation/sphinx/load_config.py b/Documentation/sphinx/load_config.py
index ec50e1ee5223..1afb0c97f06b 100644
--- a/Documentation/sphinx/load_config.py
+++ b/Documentation/sphinx/load_config.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8; mode: python -*-
+# SPDX-License-Identifier: GPL-2.0
 # pylint: disable=R0903, C0330, R0914, R0912, E0401
 
 import os
diff --git a/Documentation/sphinx/min_requirements.txt b/Documentation/sphinx/min_requirements.txt
index 52d9f27010e8..96b5e0bfa3d7 100644
--- a/Documentation/sphinx/min_requirements.txt
+++ b/Documentation/sphinx/min_requirements.txt
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
 alabaster >=0.7,<0.8
 docutils>=0.15,<0.18
 jinja2>=2.3,<3.1
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index b063f2f1cfb2..7b1458544e2e 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -1,4 +1,7 @@
 #!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@kernel.org>.
+
 use strict;
 use Text::Tabs;
 use Getopt::Long;
@@ -391,7 +394,7 @@ Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org>
 
 =head1 COPYRIGHT
 
-Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
+Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@kernel.org>.
 
 License GPLv2: GNU GPL version 2 <https://gnu.org/licenses/gpl.html>.
 
diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt
index 5017f307c8a4..76b4255061d0 100644
--- a/Documentation/sphinx/requirements.txt
+++ b/Documentation/sphinx/requirements.txt
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
 alabaster
 Sphinx
 pyyaml
diff --git a/Documentation/sphinx/rstFlatTable.py b/Documentation/sphinx/rstFlatTable.py
index 180fbb50c337..3d19569e5728 100755
--- a/Documentation/sphinx/rstFlatTable.py
+++ b/Documentation/sphinx/rstFlatTable.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8; mode: python -*-
+# SPDX-License-Identifier: GPL-2.0
 # pylint: disable=C0330, R0903, R0912
 
 """
-- 
2.49.0

Re: [PATCH] docs: sphinx: add missing SPDX tags
Posted by Jonathan Corbet 5 months, 3 weeks ago
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:

> Several Sphinx extensions and tools are missing SPDX tags.
> Add them.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  Documentation/sphinx/cdomain.py           | 1 +
>  Documentation/sphinx/kernel_include.py    | 1 +
>  Documentation/sphinx/kerneldoc.py         | 1 +
>  Documentation/sphinx/kfigure.py           | 1 +
>  Documentation/sphinx/load_config.py       | 1 +
>  Documentation/sphinx/min_requirements.txt | 1 +
>  Documentation/sphinx/parse-headers.pl     | 5 ++++-
>  Documentation/sphinx/requirements.txt     | 1 +
>  Documentation/sphinx/rstFlatTable.py      | 1 +
>  9 files changed, 12 insertions(+), 1 deletion(-)

I've applied this, but the patch led me to wonder...

> diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
> index e8ea80d4324c..3dc285dc70f5 100644
> --- a/Documentation/sphinx/cdomain.py
> +++ b/Documentation/sphinx/cdomain.py
> @@ -1,4 +1,5 @@
>  # -*- coding: utf-8; mode: python -*-

Do we really need these lines?  UTF8 should be the default almost
anywhere, and Emacs understands that a .py file will require Python
mode...

Thanks,

jon
Re: [PATCH] docs: sphinx: add missing SPDX tags
Posted by Mauro Carvalho Chehab 5 months, 3 weeks ago
Em Wed, 25 Jun 2025 12:41:01 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:
> 
> > Several Sphinx extensions and tools are missing SPDX tags.
> > Add them.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > ---
> >  Documentation/sphinx/cdomain.py           | 1 +
> >  Documentation/sphinx/kernel_include.py    | 1 +
> >  Documentation/sphinx/kerneldoc.py         | 1 +
> >  Documentation/sphinx/kfigure.py           | 1 +
> >  Documentation/sphinx/load_config.py       | 1 +
> >  Documentation/sphinx/min_requirements.txt | 1 +
> >  Documentation/sphinx/parse-headers.pl     | 5 ++++-
> >  Documentation/sphinx/requirements.txt     | 1 +
> >  Documentation/sphinx/rstFlatTable.py      | 1 +
> >  9 files changed, 12 insertions(+), 1 deletion(-)  
> 
> I've applied this, but the patch led me to wonder...

Thanks!

> 
> > diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
> > index e8ea80d4324c..3dc285dc70f5 100644
> > --- a/Documentation/sphinx/cdomain.py
> > +++ b/Documentation/sphinx/cdomain.py
> > @@ -1,4 +1,5 @@
> >  # -*- coding: utf-8; mode: python -*-  
> 
> Do we really need these lines?  UTF8 should be the default almost
> anywhere, and Emacs understands that a .py file will require Python
> mode...

Heh, I had the same filling when I saw that. I almost dropped ;-)

perhaps we could run some linters on it and so some cleanups,
inclusing the removal of those, placing instead some copyright
notes on the top of it... well, there are already copyrights there
(and at the other Sphinx extensions). In this specific case:

"""
    cdomain
    ~~~~~~~

    Replacement for the sphinx c-domain.

    :copyright:  Copyright (C) 2016  Markus Heiser
    :license:    GPL Version 2, June 1991 see Linux/COPYING for details.

So, not sure about it. What do you think?

Thanks,
Mauro