Skip to contentSkip to conversation

docs/sphinx: Fix syntax errors and warnings

PATCH In review Andrew Cooper 4 participants 14 messages Nov 8, 2023 – Nov 11, 2023

lore
Share & tools
lore
#0 lore raw

cover docs/sphinx: Fix syntax errors and warnings

Given the two mandatory 4.18 fixes, this is the remainder of the work I have been threatening to do for a while. Preferrably for 4.18 too, seeing as this gets our Sphinx docs into better shape.

I still want to make sphinx problems fatal in gitlab, but that will have to wait for now.

Andrew Cooper (3):
docs/sphinx: Fix syntax issues in hyperlaunch.rst docs/sphinx: Fix syntax issues in exclude-list.rst docs/sphinx: Fix indexing

 docs/designs/launch/hyperlaunch.rst | 19 +++++++++++--------
 docs/index.rst                      | 13 +++++++------
 docs/misra/exclude-list.rst         |  3 ++-
 docs/misra/index.rst                | 18 ++++++++++++++++++
 4 files changed, 38 insertions(+), 15 deletions(-)
 create mode 100644 docs/misra/index.rst
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/3 docs/sphinx: Fix syntax issues in hyperlaunch.rst

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst:111: WARNING: Title underline too short. docs/designs/launch/hyperlaunch.rst:203: WARNING: Unexpected indentation. docs/designs/launch/hyperlaunch.rst:216: WARNING: Unexpected indentation.

Nested lists require newlines as delimiters.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
CC: Christopher Clark <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Henry Wang <[email protected]>

---
 docs/designs/launch/hyperlaunch.rst | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
docs/designs/launch/hyperlaunch.rst +11 -8
index 4c138da884cc..3bed36f97637 100644
@@ -108,7 +108,7 @@ both modes of configuration from the same binary and when paired with its XSM
 flask, provides strong controls that enable fine grained system partitioning.
 
 Hypervisor Launch Landscape
----------
+---------------------------
 
 This comparison table presents the distinctive capabilities of Hyperlaunch with
 reference to existing launch configurations currently available in Xen and
@@ -200,11 +200,13 @@ The benefits of this structure include:
   domains.
 * Commonality: Reuses the same logic for initial basic domain building across
   diverse Xen deployments.
-	* It aligns the x86 initial domain construction with the existing Arm
-	  dom0less feature for construction of multiple domains at boot.
-	* The boot domain implementation may vary significantly with different
-	  deployment use cases, whereas the hypervisor implementation is
-	  common.
+
+  * It aligns the x86 initial domain construction with the existing Arm
+    dom0less feature for construction of multiple domains at boot.
+
+  * The boot domain implementation may vary significantly with different
+    deployment use cases, whereas the hypervisor implementation is common.
+
 * Correctness: Increases confidence in the implementation of domain
   construction, since it is performed by the hypervisor in well maintained and
   centrally tested logic.
@@ -213,8 +215,9 @@ The benefits of this structure include:
 * Capability: Supports launch of advanced configurations where a sequenced
   start of multiple domains is required, or multiple domains are involved in
   startup of the running system configuration
-	* eg. for PCI passthrough on systems where the toolstack runs in a
-	  separate domain to the hardware management.
+
+  * eg. for PCI passthrough on systems where the toolstack runs in a separate
+    domain to the hardware management.
 
 Please, see the ‘Hyperlaunch Device Tree’ design document, which describes the
 configuration module that is provided to the hypervisor by the bootloader.
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH for-4.18 1/3] docs/sphinx: Fix syntax issues in hyperlaunch.rst

Hi Andrew,

Quoted 11 lines · Andrew Cooper

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst:111: WARNING: Title underline too short. docs/designs/launch/hyperlaunch.rst:203: WARNING: Unexpected indentation. docs/designs/launch/hyperlaunch.rst:216: WARNING: Unexpected indentation.

Nested lists require newlines as delimiters.

Kind regards,
Henry

Acked-by on v1 1/3
#3 lore raw

Re: [PATCH for-4.18 1/3] docs/sphinx: Fix syntax issues in hyperlaunch.rst

In reply to Andrew Cooper
Quoted 9 lines · Andrew Cooper

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst:111: WARNING: Title underline too short. docs/designs/launch/hyperlaunch.rst:203: WARNING: Unexpected indentation. docs/designs/launch/hyperlaunch.rst:216: WARNING: Unexpected indentation.

Nested lists require newlines as delimiters.

#4 lore raw

PATCH 2/3 docs/sphinx: Fix syntax issues in exclude-list.rst

In reply to Andrew Cooper

sphinx-build reports:

docs/misra/exclude-list.rst:47: WARNING: Unexpected indentation. docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.

Nested lists require newlines as delimiters, and * either needs escaping, or put in a literal block.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
CC: Luca Fancellu <[email protected]>
CC: Henry Wang <[email protected]>

---
 docs/misra/exclude-list.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
docs/misra/exclude-list.rst +2 -1
index 42dbceb82523..a63b128c3d27 100644
@@ -44,10 +44,11 @@ Here is an explanation of the fields inside an object of the "content" array:
    their results. This field is optional and when not specified, it means every
    checker will use that entry.
    Current implemented values for this field are:
+
     - xen-analysis: the xen-analysis.py script exclude this entry for both MISRA
       and static analysis scan. (Implemented only for Cppcheck tool)
 
 To ease the review and the modifications of the entries, they shall be listed in
 alphabetical order referring to the rel_path field.
-Excluded folder paths shall end with '/*' in order to match everything on that
+Excluded folder paths shall end with ``/*`` in order to match everything on that
 folder.
Signature · 1 line
2.30.2
Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH for-4.18 2/3] docs/sphinx: Fix syntax issues in exclude-list.rst

Quoted 14 lines · Andrew Cooper

sphinx-build reports:

docs/misra/exclude-list.rst:47: WARNING: Unexpected indentation. docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.

Nested lists require newlines as delimiters, and * either needs escaping, or put in a literal block.

---

Thanks for that.

Cheers,
Luca

#6 lore raw

Re: [PATCH for-4.18 2/3] docs/sphinx: Fix syntax issues in exclude-list.rst

Hi,

Quoted 12 lines · Luca Fancellu
Quoted 11 lines · Andrew Cooper

sphinx-build reports:

docs/misra/exclude-list.rst:47: WARNING: Unexpected indentation. docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.

Nested lists require newlines as delimiters, and * either needs escaping, or put in a literal block.

Quoted 6 lines
Quoted 2 lines

---

Thanks for that.

Kind regards,
Henry

Quoted 6 lines

Cheers,
Luca

#7 lore raw

Re: [PATCH for-4.18 2/3] docs/sphinx: Fix syntax issues in exclude-list.rst

In reply to Luca Fancellu
Quoted 10 lines · Luca Fancellu
Quoted 10 lines · Andrew Cooper

sphinx-build reports:

docs/misra/exclude-list.rst:47: WARNING: Unexpected indentation. docs/misra/exclude-list.rst:50: WARNING: Inline emphasis start-string without end-string.

Nested lists require newlines as delimiters, and * either needs escaping, or put in a literal block.

Quoted 6 lines
Quoted 2 lines

---

Thanks for that.

#8 lore raw

PATCH 3/3 docs/sphinx: Fix indexing

In reply to Andrew Cooper

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst: WARNING: document isn't included in any toctree docs/designs/launch/hyperlaunch-devicetree.rst: WARNING: document isn't included in any toctree docs/misc/xen-makefiles/makefiles.rst: WARNING: document isn't included in any toctree docs/misra/C-language-toolchain.rst: WARNING: document isn't included in any toctree docs/misra/C-runtime-failures.rst: WARNING: document isn't included in any toctree docs/misra/documenting-violations.rst: WARNING: document isn't included in any toctree docs/misra/exclude-list.rst: WARNING: document isn't included in any toctree docs/misra/xen-static-analysis.rst: WARNING: document isn't included in any toctree

Create an up-to-date index.rst in misra/ create an "unsorted docs" section at the top level to contain everything else. They can be re-filed at a later date.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
CC: Henry Wang <[email protected]>

---
 docs/index.rst       | 13 +++++++------
 docs/misra/index.rst | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 docs/misra/index.rst
docs/index.rst +7 -6
index f3f779f89ce5..22fdde80590c 100644
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.
 
 .. toctree::
    :maxdepth: 2
 
-   misra/rules
-   misra/deviations
+   designs/launch/hyperlaunch
+   designs/launch/hyperlaunch-devicetree
+   misc/xen-makefiles/makefiles
+   misra/index
 
 
 Miscellanea
docs/misra/index.rst new file +18 -0
new file mode 100644
index 000000000000..c59730c46d88
@@ -0,0 +1,18 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+MISRA C coding guidelines
+=========================
+
+MISRA C rules and directive to be used as coding guidelines when writing
+Xen hypervisor code.
+
+.. toctree::
+   :maxdepth: 2
+
+   rules
+   deviations
+   C-language-toolchain
+   C-runtime-failures
+   documenting-violations
+   exclude-list
+   xen-static-analysis
Signature · 1 line
2.30.2
#9 lore raw

Re: [PATCH for-4.18 3/3] docs/sphinx: Fix indexing

Hi,

Quoted 13 lines · Andrew Cooper

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst: WARNING: document isn't included in any toctree docs/designs/launch/hyperlaunch-devicetree.rst: WARNING: document isn't included in any toctree docs/misc/xen-makefiles/makefiles.rst: WARNING: document isn't included in any toctree docs/misra/C-language-toolchain.rst: WARNING: document isn't included in any toctree docs/misra/C-runtime-failures.rst: WARNING: document isn't included in any toctree docs/misra/documenting-violations.rst: WARNING: document isn't included in any toctree docs/misra/exclude-list.rst: WARNING: document isn't included in any toctree docs/misra/xen-static-analysis.rst: WARNING: document isn't included in any toctree

Quoted 5 lines

Create an up-to-date index.rst in misra/ create an "unsorted docs" section at the top level to contain everything else. They can be re-filed at a later date.

Kind regards,
Henry

#10 lore raw

Re: [PATCH for-4.18 3/3] docs/sphinx: Fix indexing

In reply to Andrew Cooper
Quoted 36 lines · Andrew Cooper

sphinx-build reports:

docs/designs/launch/hyperlaunch.rst: WARNING: document isn't included in any toctree docs/designs/launch/hyperlaunch-devicetree.rst: WARNING: document isn't included in any toctree docs/misc/xen-makefiles/makefiles.rst: WARNING: document isn't included in any toctree docs/misra/C-language-toolchain.rst: WARNING: document isn't included in any toctree docs/misra/C-runtime-failures.rst: WARNING: document isn't included in any toctree docs/misra/documenting-violations.rst: WARNING: document isn't included in any toctree docs/misra/exclude-list.rst: WARNING: document isn't included in any toctree docs/misra/xen-static-analysis.rst: WARNING: document isn't included in any toctree

Create an up-to-date index.rst in misra/ create an "unsorted docs" section at the top level to contain everything else. They can be re-filed at a later date.

---
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
CC: Henry Wang <[email protected]>

---
 docs/index.rst       | 13 +++++++------
 docs/misra/index.rst | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)
 create mode 100644 docs/misra/index.rst
docs/index.rst +0 -0
index f3f779f89ce5..22fdde80590c 100644
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index

docs/index.rst kind of development environment. · line 59

Quoted 10 lines
docs/index.rst +3 -4
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.

I understand the need for an "Unsorted documents", but why taking away "MISRA C coding guidelines" from here? Wouldn't we want:

Unsorted documents
------------------

designs/launch/hyperlaunch
designs/launch/hyperlaunch-devicetree
misc/xen-makefiles/makefiles

MISRA C coding guidelines
-------------------------

MISRA C rules and directive to be used as coding guidelines when writing Xen hypervisor code and related files.

misra/index

Quoted 18 lines
docs/index.rst +4 -2
 .. toctree::
    :maxdepth: 2
 
-   misra/rules
-   misra/deviations
+   designs/launch/hyperlaunch
+   designs/launch/hyperlaunch-devicetree
+   misc/xen-makefiles/makefiles
+   misra/index
 
 
 Miscellanea
docs/misra/index.rst new file +0 -0
new file mode 100644
index 000000000000..c59730c46d88

docs/misra/index.rst line 7

Quoted 7 lines
docs/misra/index.rst new file +7 -0
@@ -0,0 +1,18 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+MISRA C coding guidelines
+=========================
+
+MISRA C rules and directive to be used as coding guidelines when writing
+Xen hypervisor code.

This is fine. I would expand it a bit appending "and related documents":

MISRA C rules and directive to be used as coding guidelines when writing Xen hypervisor code and related documents.

Quoted 13 lines
docs/misra/index.rst new file +10 -0
+.. toctree::
+   :maxdepth: 2
+
+   rules
+   deviations
+   C-language-toolchain
+   C-runtime-failures
+   documenting-violations
+   exclude-list
+   xen-static-analysis
Signature · 1 line
2.30.2
#11 lore raw

Re: [PATCH for-4.18 3/3] docs/sphinx: Fix indexing

Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Andrew Cooper
docs/index.rst +2 -2
index f3f779f89ce5..22fdde80590c 100644
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
Quoted 5 lines

docs/index.rst kind of development environment. · line 59

Quoted 3 lines
docs/index.rst +1 -2
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.

I understand the need for an "Unsorted documents", but why taking away "MISRA C coding guidelines" from here?

You can't have it both here and in index.rst without breaking the indexing.

Also because in it's current position it breaks the navbar.  MISRA is part of the developer guide, and what should be at the toplevel should be a general section on safety certification, which cross-references the developer guide amongst other things.  Nevertheless it will stay visible for now at the top level because of how the toctree.

It's in unsorted because I have thrown the index together with the bare minimum effort in order to fix Sphinx errors in time for 4.18.

This is also why I'm not changing any text.  There is 0 time between now and this needing fixing for the release.

Someone else can find some time to polish it - which is far more work than just in the index - and we can backport it when its done.

~Andrew

#12 lore raw

Re: [PATCH for-4.18 3/3] docs/sphinx: Fix indexing

Quoted 29 lines · Andrew Cooper
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Andrew Cooper
docs/index.rst +2 -2
index f3f779f89ce5..22fdde80590c 100644
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
Quoted 5 lines

docs/index.rst kind of development environment. · line 59

Quoted 3 lines
docs/index.rst +1 -2
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.

I understand the need for an "Unsorted documents", but why taking away "MISRA C coding guidelines" from here?

You can't have it both here and in index.rst without breaking the indexing.

Also because in it's current position it breaks the navbar.  MISRA is part of the developer guide, and what should be at the toplevel should be a general section on safety certification, which cross-references the developer guide amongst other things.  Nevertheless it will stay visible for now at the top level because of how the toctree.

Quoted 8 lines

It's in unsorted because I have thrown the index together with the bare minimum effort in order to fix Sphinx errors in time for 4.18.

This is also why I'm not changing any text.  There is 0 time between now and this needing fixing for the release.

Someone else can find some time to polish it - which is far more work than just in the index - and we can backport it when its done.

OK. I don't mean to make things difficult so if you don't think it is easy to keep "MISRA C coding guidelines" here in docs/index.rst then so be it. Can you at least add "and related files" to the text in docs/misra/index.rst? Can be done on commit. Anyway:

#13 lore raw

Re: [PATCH for-4.18 3/3] docs/sphinx: Fix indexing

Quoted 35 lines · Stefano Stabellini
Quoted 34 lines · Andrew Cooper
Quoted 14 lines · Stefano Stabellini
Quoted 13 lines · Andrew Cooper
docs/index.rst +2 -2
index f3f779f89ce5..22fdde80590c 100644
@@ -53,17 +53,18 @@ kind of development environment.
    hypervisor-guide/index
 
 
-MISRA C coding guidelines
--------------------------
+Unsorted documents
+------------------
 
Quoted 5 lines

docs/index.rst kind of development environment. · line 59

Quoted 3 lines
docs/index.rst +1 -2
-MISRA C rules and directive to be used as coding guidelines when writing
-Xen hypervisor code.
+Documents in need of some rearranging.

I understand the need for an "Unsorted documents", but why taking away "MISRA C coding guidelines" from here?

You can't have it both here and in index.rst without breaking the indexing.

Also because in it's current position it breaks the navbar.  MISRA is part of the developer guide, and what should be at the toplevel should be a general section on safety certification, which cross-references the developer guide amongst other things.  Nevertheless it will stay visible for now at the top level because of how the toctree.

It's in unsorted because I have thrown the index together with the bare minimum effort in order to fix Sphinx errors in time for 4.18.

This is also why I'm not changing any text.  There is 0 time between now and this needing fixing for the release.

Quoted 6 lines
Quoted 2 lines

Someone else can find some time to polish it - which is far more work than just in the index - and we can backport it when its done.

OK. I don't mean to make things difficult so if you don't think it is easy to keep "MISRA C coding guidelines" here in docs/index.rst then so be it. Can you at least add "and related files" to the text in docs/misra/index.rst?

Ok.

Quoted 3 lines

Can be done on commit. Anyway:

Thanks.

~Andrew