diff mbox series

[b4,1/3] ez: do not interpret 'prep-perpatch-check-cmd' str as list of chars

Message ID 20240815-extend-checkpatch-v1-1-ab7f654be699@linaro.org (mailing list archive)
State Changes Requested
Headers show
Series Extend checkpatch.pl compatibilities | expand

Commit Message

Manos Pitsidianakis Aug. 15, 2024, 1:36 p.m. UTC
config.get('prep-perpatch-check-cmd') returns a string, which in python
is also a list of chars, which in python is also a list of str. This
leads to a moderately funny failure where b4 tries to execute each
character as a separate command:

  $ b4 prep --check
  Checking patches using:
    s
    c
    r
    i
    p
    t
    s
    /
    c
    h
    e
    c
    k
    p
    a
    t
    c
    h
    .
    p
    l

    -
    q

    -
    -
    t
    e
    r
    s
    e

... and so on.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 src/b4/ez.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/src/b4/ez.py b/src/b4/ez.py
index 22a2cdf..20fbd76 100644
--- a/src/b4/ez.py
+++ b/src/b4/ez.py
@@ -1666,6 +1666,8 @@  def get_check_cmds() -> Tuple[List[str], List[str]]:
     scmds = list()
     if config.get('prep-perpatch-check-cmd'):
         ppcmds = config.get('prep-perpatch-check-cmd')
+        if isinstance(ppcmds, str):
+            ppcmds = [ppcmds]
     else:
         # Use recommended checkpatch defaults if we find checkpatch
         topdir = b4.git_get_toplevel()