qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] pylint: fix errors and warnings from qemu-tests test 297


From: Emanuele Giuseppe Esposito
Subject: Re: [PATCH 1/2] pylint: fix errors and warnings from qemu-tests test 297
Date: Thu, 7 Oct 2021 09:51:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1



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 via email to

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