qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 1/2] pylint: fix errors and warnings from qemu-tests test 297
Date: Thu, 7 Oct 2021 09:51:27 +0200	[thread overview]
Message-ID: <3a143653-582e-5b28-f536-bf24c4e45ac8@redhat.com> (raw)
In-Reply-To: <YV3S9N8SnU4W+aYL@redhat.com>



On 06/10/2021 18:46, Kevin Wolf wrote:
> Am 06.10.2021 um 15:00 hat Emanuele Giuseppe Esposito geschrieben:
>> Test 297 in qemu-iotests folder currently fails: pylint has
>> learned new things to check, or we simply missed them.
>>
>> All fixes in this patch are related to additional spaces used
>> or wrong indentation.
>>
>> No functional change intended.
>>
>> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> 
>> @@ -87,13 +87,14 @@ class TestStopWithBlockJob(iotests.QMPTestCase):
>>           iotests.qemu_img('create', '-f', iotests.imgfmt, self.overlay_img,
>>                            '1G')
>>   
>> -        result = self.vm.qmp('blockdev-add', **{
>> +        result = self.vm.qmp('blockdev-add',
>> +                             **{
>>                                    'node-name': 'overlay',
>>                                    'driver': iotests.imgfmt,
>>                                    'file': {
>>                                        'driver': 'file',
>>                                        'filename': self.overlay_img
>> -                                 }
>> +                                     }
>>                                })
>>           self.assert_qmp(result, 'return', {})
> 
> Am I the only one to think that the new indentation for the closing
> brace there is horrible? PEP-8 explictly allows things like:
> 
>      my_list = [
>          1, 2, 3,
>          4, 5, 6,
>      ]
> 
> Some of the other changes in this patch should be made, but at least if
> these are behind different switches, I would consider just disabling the
> one that complains about nicely formatted dicts.

The error is "C0330: Wrong hanging indentation"
so it is not about dicts. I guess we can disable the error, but the 
problem is that we will disable it for the whole file, which doesn't 
seem right.

Alternatively, this also works fine:

-        result = self.vm.qmp('blockdev-add',
-                             **{
-                                 'node-name': 'overlay',
-                                 'driver': iotests.imgfmt,
-                                 'file': {
-                                     'driver': 'file',
-                                     'filename': self.overlay_img
-                                     }
-                             })
+        result = self.vm.qmp('blockdev-add', **{
+            'node-name': 'overlay',
+            'driver': iotests.imgfmt,
+            'file': {
+                'driver': 'file',
+                'filename': self.overlay_img
+            }})

What do you think?

Otherwise I am happy to disable the error altogether.

Emanuele



  reply	other threads:[~2021-10-07  7:52 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 [this message]
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
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=3a143653-582e-5b28-f536-bf24c4e45ac8@redhat.com \
    --to=eesposit@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@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).