[dpdk-dev] [PATCH] devtools: refuse indent with tabs in Meson
Bruce Richardson
bruce.richardson at intel.com
Wed Oct 27 11:57:24 CEST 2021
On Fri, Oct 22, 2021 at 10:55:31PM +0200, David Marchand wrote:
> The rule for indentation in Meson in DPDK is 4 spaces.
>
> Any tab should be flagged as an issue, let's extend the check and fix
> existing offenders.
>
> Fixes: 4ad4b20a7905 ("drivers: change indentation in build files")
> Fixes: 2457705e6474 ("crypto/cnxk: add driver skeleton")
> Fixes: 634b73104482 ("app/testpmd: build on Windows")
> Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF")
> Fixes: 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")
> Fixes: e1369718f553 ("common/octeontx: enable build only on 64-bit Linux")
> Fixes: 2b504721bfda ("app/bbdev: enable la12xx")
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
One small comment inline below.
> ---
> app/pdump/meson.build | 6 +--
> app/proc-info/meson.build | 6 +--
> app/test-acl/meson.build | 6 +--
> app/test-bbdev/meson.build | 8 ++--
> app/test-cmdline/meson.build | 6 +--
> app/test-compress-perf/meson.build | 6 +--
> app/test-crypto-perf/meson.build | 6 +--
> app/test-eventdev/meson.build | 6 +--
> app/test-fib/meson.build | 6 +--
> app/test-flow-perf/meson.build | 6 +--
> app/test-pipeline/meson.build | 6 +--
> app/test-regex/meson.build | 6 +--
> app/test-sad/meson.build | 6 +--
> app/test/meson.build | 6 +--
> config/meson.build | 58 +++++++++++++--------------
> devtools/check-meson.py | 3 ++
> drivers/compress/octeontx/meson.build | 6 +--
> drivers/crypto/cnxk/meson.build | 6 +--
> drivers/crypto/qat/meson.build | 2 +-
> drivers/net/ice/meson.build | 2 +-
> 20 files changed, 83 insertions(+), 80 deletions(-)
>
<snip>
> diff --git a/devtools/check-meson.py b/devtools/check-meson.py
> index 29f7887968..4b2338828d 100755
> --- a/devtools/check-meson.py
> +++ b/devtools/check-meson.py
> @@ -8,6 +8,7 @@
>
> import sys
> import os
> +import re
> from os.path import relpath, join
> from argparse import ArgumentParser
>
> @@ -50,6 +51,8 @@ def check_indentation(filename, contents):
> code, comments = split_code_comments(line)
> if not code.strip():
> continue
> + if re.match('^ *\t', code):
> + print(f'Error parsing {filename}:{lineno}, got some tabulation')
> if code.endswith('files('):
> if infiles:
> raise(f'Error parsing {filename}:{lineno}, got "files(" when already parsing files list')
I wonder is there ever any scenario where we want to allow tabs on a line?
If not, then rather than using regex, the check could be simplified to:
if '\t' in line:
> diff --git a/drivers/compress/octeontx/meson.build b/drivers/compress/octeontx/meson.build
> index cd8687fde3..3a29c3e609 100644
> --- a/drivers/compress/octeontx/meson.build
> +++ b/drivers/compress/octeontx/meson.build
<snip>
More information about the dev
mailing list