Skip to contentSkip to conversation

doc: run rst2* with --strict to catch warnings

PATCH In review Frank Lichtenheld 3 participants 3 messages Mar 31, 2023 – Apr 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: run rst2* with --strict to catch warnings

Basically -Werror for docutils.

Fix all issues raised by this. The following issue classes were reported:

Possible title underline, too short for the title. Treating it as ordinary text because it's so short. (:: at the start of the line directly below text, either add empty line of merge into : on previous line)

Enumerated list start value not ordinal-1 (error in numbering)

Change-Id Id3b0f7be4602f70115c60e6ddb89f6ed58e94e64
---
 doc/Makefile.am                               |  6 ++-
 doc/man-sections/connection-profiles.rst      |  3 +-
 doc/man-sections/example-fingerprint.rst      |  7 ++-
 doc/man-sections/examples.rst                 | 51 +++++++------------
 .../virtual-routing-and-forwarding.rst        |  6 ++-
 5 files changed, 30 insertions(+), 43 deletions(-)
doc/Makefile.am +4 -2
index 13e6a64e..bb9c935d 100644
@@ -68,19 +68,21 @@ openvpn-examples.5 openvpn-examples.5.html: $(openvpn_examples_sections)
 
 SUFFIXES = .8.rst .8 .8.html .5.rst .5 .5.html
 
+RST_FLAGS = --strict
+
 MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
 .8.rst.8 .5.rst.5 :
 if HAVE_PYDOCUTILS
-	$(RST2MAN) $< > $@
+	$(RST2MAN) $(RST_FLAGS) $< > $@
 else
 	@echo "Missing python-docutils - skipping man page generation ($@)"
 endif
 
 .8.rst.8.html .5.rst.5.html :
 if HAVE_PYDOCUTILS
-	$(RST2HTML) $< > $@
+	$(RST2HTML) $(RST_FLAGS) $< > $@
 else
 	@echo "Missing python-docutils - skipping html page generation ($@)"
 endif
doc/man-sections/connection-profiles.rst +1 -2
index fd3382b2..c8816e10 100644
@@ -16,8 +16,7 @@ achieves a successful connection.
 ``--remote-random`` can be used to initially "scramble" the connection
 list.
 
-Here is an example of connection profile usage:
-::
+Here is an example of connection profile usage::
 
    client
    dev tun
doc/man-sections/example-fingerprint.rst +3 -4
index 852cca49..7cdda190 100644
@@ -34,8 +34,7 @@ Server setup
      SHA256 Fingerprint=00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff
 
 
-3. Write a server configuration (`server.conf`):
-::
+4. Write a server configuration (`server.conf`)::
 
     # The server certificate we created in step 1
     cert server.crt
@@ -65,9 +64,9 @@ Server setup
     # Ping every 60s, restart if no data received for 5 minutes
     keepalive 60 300
 
-4. Add at least one client as described in the client section.
+5. Add at least one client as described in the client section.
 
-5. Start the server.
+6. Start the server.
     - On systemd based distributions move `server.crt`, `server.key` and
       `server.conf` to :code:`/etc/openvpn/server` and start it via systemctl
 
doc/man-sections/examples.rst +18 -33

138 lines not on this page · raw message

doc/man-sections/virtual-routing-and-forwarding.rst +4 -2
index 28c13eee..db5f1abc 100644
@@ -23,11 +23,13 @@ VRF setup with iproute2
 ```````````````````````
 
 Create VRF :code:`vrf_external` and map it to routing table :code:`1023`
+
 ::
 
       ip link add vrf_external type vrf table 1023
 
 Move :code:`eth0` into :code:`vrf_external`
+
 ::
 
       ip link set master vrf_external dev eth0
@@ -42,8 +44,7 @@ VRF setup with ifupdown
 For Debian based Distributions :code:`ifupdown2` provides an almost drop-in
 replacement for :code:`ifupdown` including VRFs and other features.
 A configuration for an interface :code:`eth0` being part of VRF
-code:`vrf_external` could look like this:
-::
+code:`vrf_external` could look like this::
 
       auto eth0
       iface eth0
@@ -61,6 +62,7 @@ code:`vrf_external` could look like this:
 OpenVPN configuration
 `````````````````````
 The OpenVPN configuration needs to contain this line:
+
 ::
 
       bind-dev vrf_external
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Am 31.03.23 um 15:24 schrieb Frank Lichtenheld:

Quoted 5 lines

Basically -Werror for docutils.

Fix all issues raised by this. The following issue classes were reported:

Quoted 7 lines

Possible title underline, too short for the title. Treating it as ordinary text because it's so short. (:: at the start of the line directly below text, either add empty line of merge into : on previous line)

Enumerated list start value not ordinal-1 (error in numbering)

Thanks. That helps catching these mistakes early.

#2 lore raw
In reply to Frank Lichtenheld

Thanks for digging into this and enlightening us non-rst-enlightened mortals with the findings :-)

Lightly tested with GH Actions (I hope we actually do build the doc stuff there ;-) ).

Your patch has been applied to the master and release/2.6 branch.

commit fafb05f6f3a7a1b46c278961ec8d2d8970f01096 (master) commit 2002a5ca296d60b383c6b0f20148cf26c2b87a4c (release/2.6)

Author: Frank Lichtenheld
Date:   Fri Mar 31 15:24:29 2023 +0200
     doc: run rst2* with --strict to catch warnings

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26567.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering