devtools: refuse indent with tabs in Meson
Subsystems (3)
PATCH 1/1 devtools: refuse indent with tabs in Meson
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.
--- 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(-)
app/pdump/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/proc-info/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/test-acl/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2019 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/test-bbdev/meson.build +4 -4
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
@@ -24,5 +24,5 @@ if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') - deps += ['baseband_la12xx'] + deps += ['baseband_la12xx'] endif
app/test-cmdline/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2019 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('commands.c', 'cmdline_test.c')
app/test-compress-perf/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
app/test-crypto-perf/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
app/test-eventdev/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2017 Cavium, Inc if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
app/test-fib/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2019 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/test-flow-perf/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2020 Mellanox Technologies, Ltd if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
app/test-pipeline/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2019 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files(
app/test-regex/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright 2020 Mellanox Technologies, Ltd if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/test-sad/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2019 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif sources = files('main.c')
app/test/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2017 Intel Corporation if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() + build = false + reason = 'not supported on Windows' + subdir_done() endif if not get_option('tests')
config/meson.build +29 -29
76 lines not on this page · raw message
devtools/check-meson.py +3 -0
@@ -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')
drivers/compress/octeontx/meson.build +3 -3
@@ -2,9 +2,9 @@ # Copyright(c) 2018 Cavium, Inc if not is_linux or not dpdk_conf.get('RTE_ARCH_64') - build = false - reason = 'only supported on 64-bit Linux' - subdir_done() + build = false + reason = 'only supported on 64-bit Linux' + subdir_done() endif sources = files('otx_zip.c', 'otx_zip_pmd.c')
drivers/crypto/cnxk/meson.build +3 -3
@@ -3,9 +3,9 @@ # if not is_linux or not dpdk_conf.get('RTE_ARCH_64') - build = false - reason = 'only supported on 64-bit Linux' - subdir_done() + build = false + reason = 'only supported on 64-bit Linux' + subdir_done() endif sources = files(
drivers/crypto/qat/meson.build +1 -1
@@ -19,7 +19,7 @@ if dep.found() 'qat_sym_hw_dp.c', 'qat_sym_pmd.c', 'qat_sym_session.c', - ) + ) qat_ext_deps += dep qat_cflags += '-DBUILD_QAT_SYM' qat_cflags += '-DBUILD_QAT_ASYM'
drivers/net/ice/meson.build +1 -1
@@ -71,6 +71,6 @@ sources += files('ice_dcf.c', 'ice_dcf_vf_representor.c', 'ice_dcf_ethdev.c', 'ice_dcf_parent.c', - 'ice_dcf_sched.c') + 'ice_dcf_sched.c') headers = files('rte_pmd_ice.h')
Signature · 1 line
2.23.0
Quoted 13 lines · David Marchand
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")
Quoted 1 line
Signed-off-by David Marchand <[email protected]>
One small comment inline below.
Quoted 23 lines
--- 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>
Quoted 13 lines
devtools/check-meson.py +1
-0@@ -8,6 +8,7 @@ import sys import os +import re from os.path import relpath, join from argparse import ArgumentParser
devtools/check-meson.py def check_indentation(filename, contents): · line 58
Quoted 8 lines
devtools/check-meson.py +2
-0@@ -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:
Quoted 4 lines
drivers/compress/octeontx/meson.build +0
-0
<snip>
Quoted 4 lines · Bruce Richardson
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:
I am not sure.
I considered cases with tabs in log messages.
Signature · 1 line
David Marchand
Quoted 10 lines · David Marchand
Quoted 4 lines · Bruce Richardson
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:
I am not sure.
I considered cases with tabs in log messages.
Ok. I think we'd live without tabs in log messages if we had to, but for now your version is safer as it allows us to keep everything else unchanged.
/Bruce
David Marchand
Acked-by Stephen HemmingerQuoted 15 lines · Bruce Richardson
Quoted 13 lines · David Marchand
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")
Quoted 2 lines
Quoted 1 line
Signed-off-by David Marchand <[email protected]>Acked-by Bruce Richardson <[email protected]>
Fixed new issues on main, and applied, thanks.
Signature · 1 line
David Marchand
Quoted 13 lines · On Fri, 22 Oct 2021 22:55:31 +0200 David Marchand <[email protected]>…
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")
Quoted 1 line
Signed-off-by David Marchand <[email protected]>
There is also a new one in the dumpcap program, but can send follow on for that one.
Quoted 17 lines · Stephen Hemminger
Quoted 13 lines · On Fri, 22 Oct 2021 22:55:31 +0200 David Marchand <[email protected]>…
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")
Quoted 6 lines
Quoted 1 line
Signed-off-by David Marchand <[email protected]>There is also a new one in the dumpcap program, but can send follow on for that one.
Approved-by Stephen Hemminger <[email protected]>
I am not aware of this form of tag, and patchwork does not recognise it either. Converted to usual ack.
Signature · 1 line
David Marchand