devtools: forbid reference to doc.dpdk.org/guides
Checks
Commit Message
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
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>
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.
@@ -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' \