[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8d5eaebb-29ac-5ee6-20ec-09d30d33dd73@isovalent.com>
Date: Thu, 16 Sep 2021 13:12:57 +0100
From: Quentin Monnet <quentin@...valent.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
"David S. Miller" <davem@...emloft.net>,
Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
David Beckett <david.beckett@...ronome.com>,
Jakub Kicinski <kuba@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Martin KaFai Lau <kafai@...com>,
Shuah Khan <shuah@...nel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 08/24] tools: bpftool: update bpftool-prog.rst reference
2021-09-16 13:30 UTC+0200 ~ Mauro Carvalho Chehab
<mchehab+huawei@...nel.org>
> [PATCH] scripts: documentation-file-ref-check: fix bpf selftests path
>
> tools/testing/selftests/bpf/test_bpftool_synctypes.py use
> relative patches on the top of BPFTOOL_DIR:
>
> BPFTOOL_DIR = os.path.join(LINUX_ROOT, 'tools/bpf/bpftool')
>
> Change the script to automatically convert:
>
> testing/selftests/bpf -> bpf/bpftool
>
> In order to properly check the files used by such script.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
>
> diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
> index 7187ea5e5149..2d91cfe11cd2 100755
> --- a/scripts/documentation-file-ref-check
> +++ b/scripts/documentation-file-ref-check
> @@ -144,6 +144,7 @@ while (<IN>) {
> if ($f =~ m/tools/) {
> my $path = $f;
> $path =~ s,(.*)/.*,$1,;
> + $path =~ s,testing/selftests/bpf,bpf/bpftool,;
> next if (grep -e, glob("$path/$ref $path/../$ref $path/$fulref"));
> }
>
>
>
>
I tested the patch and it works well on my side.
However, this looks a bit fragile to me. There is no particular reason
to have testing/selftests/bpf point to bpf/bpftool other than to
accommodate the current case, we could imagine other selftest files
pointing to other parts of the documentation in the future. I would
instead make an exception for test_bpftool_synctypes.py specifically
(other selftest files don't usually parse documentation anyway).
Alternatively, I would look at excluding lines where the path is used in
code (tricky to detect), maybe at least when used with os.path.join():
next if ($ln =~ m,os\.path\.join\([^\,]*\,\s*['"]$fulref,);
But I'm not familiar with documentation-file-ref-check in the first
place, so these are just my two cents.
Thanks,
Quentin
Powered by blists - more mailing lists