[PATCH] test-wrap-argv.py: Actually print filename of offending script

Peter Krempa posted 1 patch 3 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/6c8e4cb2c8f258df7da054e917ca4ad01524175f.1610477487.git.pkrempa@redhat.com
scripts/test-wrap-argv.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] test-wrap-argv.py: Actually print filename of offending script
Posted by Peter Krempa 3 years, 2 months ago
The error message doesn't actually print the filename of the offending
file:

 Incorrect line wrapping in %file

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 scripts/test-wrap-argv.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/test-wrap-argv.py b/scripts/test-wrap-argv.py
index 6b0d3511f3..9ec572b479 100755
--- a/scripts/test-wrap-argv.py
+++ b/scripts/test-wrap-argv.py
@@ -137,8 +137,8 @@ def rewrap(filename, in_place, check):
                                     stdin=subprocess.PIPE)
             diff.communicate(input=new.encode('utf-8'))

-            print("Incorrect line wrapping in $file",
-                  file=sys.stderr)
+            print("Incorrect line wrapping in '%s'" %
+                  filename, file=sys.stderr)
             print("Use test-wrap-argv.py to wrap test data files",
                   file=sys.stderr)
             return False
-- 
2.29.2

Re: [PATCH] test-wrap-argv.py: Actually print filename of offending script
Posted by Daniel Henrique Barboza 3 years, 2 months ago

On 1/12/21 3:51 PM, Peter Krempa wrote:
> The error message doesn't actually print the filename of the offending
> file:
> 
>   Incorrect line wrapping in %file
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>   scripts/test-wrap-argv.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/test-wrap-argv.py b/scripts/test-wrap-argv.py
> index 6b0d3511f3..9ec572b479 100755
> --- a/scripts/test-wrap-argv.py
> +++ b/scripts/test-wrap-argv.py
> @@ -137,8 +137,8 @@ def rewrap(filename, in_place, check):
>                                       stdin=subprocess.PIPE)
>               diff.communicate(input=new.encode('utf-8'))
> 
> -            print("Incorrect line wrapping in $file",
> -                  file=sys.stderr)

Apparently my python is rusty. I would never tell that this would print

"Incorrect line wrapping in %file"



> +            print("Incorrect line wrapping in '%s'" %
> +                  filename, file=sys.stderr)


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>


>               print("Use test-wrap-argv.py to wrap test data files",
>                     file=sys.stderr)
>               return False
> 

Re: [PATCH] test-wrap-argv.py: Actually print filename of offending script
Posted by Peter Krempa 3 years, 2 months ago
On Wed, Jan 13, 2021 at 06:42:40 -0300, Daniel Henrique Barboza wrote:
> 
> 
> On 1/12/21 3:51 PM, Peter Krempa wrote:
> > The error message doesn't actually print the filename of the offending
> > file:
> > 
> >   Incorrect line wrapping in %file
> > 
> > Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> > ---
> >   scripts/test-wrap-argv.py | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/test-wrap-argv.py b/scripts/test-wrap-argv.py
> > index 6b0d3511f3..9ec572b479 100755
> > --- a/scripts/test-wrap-argv.py
> > +++ b/scripts/test-wrap-argv.py
> > @@ -137,8 +137,8 @@ def rewrap(filename, in_place, check):
> >                                       stdin=subprocess.PIPE)
> >               diff.communicate(input=new.encode('utf-8'))
> > 
> > -            print("Incorrect line wrapping in $file",
> > -                  file=sys.stderr)
> 
> Apparently my python is rusty. I would never tell that this would print
> 
> "Incorrect line wrapping in %file"

OOps, it does not. I've apparently copied from one of the outputs of
failed attempts to fix it :D

I've actually found one more mistake in scripts/group-qemu-caps.py so
I'll fix that one as well.

> 
> 
> 
> > +            print("Incorrect line wrapping in '%s'" %
> > +                  filename, file=sys.stderr)
> 
> 
> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> 
> 
> >               print("Use test-wrap-argv.py to wrap test data files",
> >                     file=sys.stderr)
> >               return False
> > 
>