devtools: forbid reference to doc.dpdk.org/guides

Message ID 20230621080920.861541-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: forbid reference to doc.dpdk.org/guides |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

David Marchand June 21, 2023, 8:09 a.m. UTC
  Putting links to doc.dpdk.org/guides in our documentation should be
avoided because it makes the documentation point at the current state of
the DPDK tree regardless of the version it is generated against.

Note: it should be acceptable to mention previous versions of DPDK (like
in old release notes), so the pattern has an explicit trailing /.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/checkpatches.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Bruce Richardson June 21, 2023, 10:51 a.m. UTC | #1
On Wed, Jun 21, 2023 at 10:09:20AM +0200, David Marchand wrote:
> Putting links to doc.dpdk.org/guides in our documentation should be
> avoided because it makes the documentation point at the current state of
> the DPDK tree regardless of the version it is generated against.
> 
> Note: it should be acceptable to mention previous versions of DPDK (like
> in old release notes), so the pattern has an explicit trailing /.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  devtools/checkpatches.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon July 20, 2023, 4:20 a.m. UTC | #2
21/06/2023 12:51, Bruce Richardson:
> On Wed, Jun 21, 2023 at 10:09:20AM +0200, David Marchand wrote:
> > Putting links to doc.dpdk.org/guides in our documentation should be
> > avoided because it makes the documentation point at the current state of
> > the DPDK tree regardless of the version it is generated against.
> > 
> > Note: it should be acceptable to mention previous versions of DPDK (like
> > in old release notes), so the pattern has an explicit trailing /.
> > 
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 15d5d67094..39235da985 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -175,6 +175,14 @@  check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
+	# don't use external URL in documentation, prefer internal references
+	awk -v FOLDERS='doc' \
+		-v EXPRESSIONS='//doc.dpdk.org/guides/' \
+		-v RET_ON_FAIL=1 \
+		-v MESSAGE='Using explicit URL to doc.dpdk.org, prefer :ref: or :doc:' \
+		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+		"$1" || res=1
+
 	# '// XXX is not set' must be preferred over '#undef XXX'
 	awk -v FOLDERS='config/rte_config.h' \
 		-v EXPRESSIONS='#undef' \