qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] qemu-iotests: fix image-fleecing pylint errors


From: Emanuele Giuseppe Esposito
Subject: Re: [PATCH 2/2] qemu-iotests: fix image-fleecing pylint errors
Date: Thu, 7 Oct 2021 12:35:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1



On 07/10/2021 10:36, Kevin Wolf wrote:
Am 07.10.2021 um 09:53 hat Emanuele Giuseppe Esposito geschrieben:


On 06/10/2021 18:51, Kevin Wolf wrote:
Am 06.10.2021 um 15:01 hat Emanuele Giuseppe Esposito geschrieben:
The problem here is that some variables are formatted with
unnecessary spaces to make it prettier and easier to read.

However, pylint complains about those additional spaces.
A solution is to transform them as string with arbitrary spaces,
and then convert it back into a tuple.

Removing the spaces makes it a little bit ugly, and directly
using the string forces us to change the test reference output
accordingly, which will 1) contain ugly weird formatted strings,
2) is not portable if somebody changes the formatting in the test
string.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>

Changing our logic because of a style checker feels wrong. I'd rather
stick in a line like this before the definitions:

# pylint: disable=bad-whitespace

(Not sure if the syntax of this is entirely correct, but from the
comment in your patch and existing uses in iotests, I think this would
be the line.)

Ok, I will add the line. Same remarks from the previous patch applies:
unfortunately then we disable the warning for the whole file.

Since here (like the previous patch) the error spans on multiple lines,
adding a # pylint: disable= comment on each line is infeasible and ugly.

It doesn't fail with my pylint version, so I can't try it out, but does
the following work?

# pylint: disable=bad-whitespace
... definitions ...
# pylint: enable=bad-whitespace

You are right, this is valid and looks very good. In this way I can just temporarily disable the error for the variables.


Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]