Skip to contentSkip to conversation

iotests/297: pylint: ignore too many statements

PATCH Superseded Vladimir Sementsov-Ogievskiy 3 participants 4 messages Jan 28, 2021 – Jan 29, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iotests/297: pylint: ignore too many statements

Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py.

Fixes 2e5a2f57db481f18fcf70be2a36b1417370b8476
Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628
---
 tests/qemu-iotests/297 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/297 +3 -1
index a37910b42d..3e3e0e34aa 100755
@@ -73,7 +73,9 @@ def run_linters():
         env['PYTHONPATH'] += os.pathsep + qemu_module_path
     except KeyError:
         env['PYTHONPATH'] = qemu_module_path
-    subprocess.run(('pylint-3', '--score=n', '--notes=FIXME,XXX', *files),
+    subprocess.run(('pylint-3', '--score=n', '--notes=FIXME,XXX',
+                    '--disable=too-many-return-statements',
+                    '--disable=too-many-statements', *files),
                    env=env, check=False)
 
     print('=== mypy ===')
Signature · 1 line
2.29.2
#1 lore raw
Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py.

Fixes 2e5a2f57db481f18fcf70be2a36b1417370b8476
Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628

---

Forget to note:

I don't add exclusions to pylintrc intentionally, as I think these warnings are reasonable, and it's good that vim ALE show them.. Still, adding them to pylintrc works too if you prefer.

Quoted 19 lines
  tests/qemu-iotests/297 | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/297 +3 -1
index a37910b42d..3e3e0e34aa 100755
@@ -73,7 +73,9 @@ def run_linters():
          env['PYTHONPATH'] += os.pathsep + qemu_module_path
      except KeyError:
          env['PYTHONPATH'] = qemu_module_path
-    subprocess.run(('pylint-3', '--score=n', '--notes=FIXME,XXX', *files),
+    subprocess.run(('pylint-3', '--score=n', '--notes=FIXME,XXX',
+                    '--disable=too-many-return-statements',
+                    '--disable=too-many-statements', *files),
                     env=env, check=False)
 
      print('=== mypy ===')
Signature · 2 lines
Best regards,
Vladimir
#2 lore raw

Am 28.01.2021 um 21:08 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 9 lines
Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py.

Fixes 2e5a2f57db481f18fcf70be2a36b1417370b8476
Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628

---

Quoted 5 lines

Forget to note:

I don't add exclusions to pylintrc intentionally, as I think these warnings are reasonable, and it's good that vim ALE show them.. Still, adding them to pylintrc works too if you prefer.

I would have disabled the warning completely because I don't think length in lines is a good measure for code quality. But if we think that these warnings are in fact reasonable, then we should fix them and not just disable them partially.

It's the same reason why we have -Werror enabled. If you leave warnings around without any intention to fix them, the useful warnings will drown in the masses of intentionally ignored ones.

Kevin

#3 lore raw
Quoted 21 lines · Kevin Wolf

Am 28.01.2021 um 21:08 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 9 lines
Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py.

Fixes 2e5a2f57db481f18fcf70be2a36b1417370b8476
Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628

---

Quoted 5 lines

Forget to note:

I don't add exclusions to pylintrc intentionally, as I think these warnings are reasonable, and it's good that vim ALE show them.. Still, adding them to pylintrc works too if you prefer.

I would have disabled the warning completely because I don't think length in lines is a good measure for code quality. But if we think that these warnings are in fact reasonable, then we should fix them and not just disable them partially.

Quoted 6 lines

It's the same reason why we have -Werror enabled. If you leave warnings around without any intention to fix them, the useful warnings will drown in the masses of intentionally ignored ones.

Kevin

It's at least a sniff test. There are extremely valid reasons for many of the "warnings" to be suppressed, but usually you should have to consciously justify it, I think.

Vladimir put the suppression in pylintrc under the "Temporary" section for v2, which I think is appropriate, so I gave it my R-B.

--js