From: Kevin Wolf <kwolf@redhat.com>
To: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 2/2] qemu-iotests: fix image-fleecing pylint errors
Date: Thu, 7 Oct 2021 10:36:35 +0200 [thread overview]
Message-ID: <YV6xk5s96HpCwxUm@redhat.com> (raw)
In-Reply-To: <ae47932f-4a0c-cfba-d222-8bf30e9da56b@redhat.com>
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
Kevin
next prev parent reply other threads:[~2021-10-07 8:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 13:00 [PATCH 0/2] pylint: fix new errors and warnings Emanuele Giuseppe Esposito
2021-10-06 13:00 ` [PATCH 1/2] pylint: fix errors and warnings from qemu-tests test 297 Emanuele Giuseppe Esposito
2021-10-06 16:46 ` Kevin Wolf
2021-10-07 7:51 ` Emanuele Giuseppe Esposito
2021-10-07 8:45 ` Kevin Wolf
2021-10-07 10:34 ` Emanuele Giuseppe Esposito
2021-10-07 16:25 ` Kevin Wolf
2021-10-06 13:01 ` [PATCH 2/2] qemu-iotests: fix image-fleecing pylint errors Emanuele Giuseppe Esposito
2021-10-06 16:51 ` Kevin Wolf
2021-10-07 7:53 ` Emanuele Giuseppe Esposito
2021-10-07 8:36 ` Kevin Wolf [this message]
2021-10-07 10:35 ` Emanuele Giuseppe Esposito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YV6xk5s96HpCwxUm@redhat.com \
--to=kwolf@redhat.com \
--cc=eesposit@redhat.com \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).