[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/15] python: Add 'fh' to known-good variable names
From: |
John Snow |
Subject: |
[PATCH 06/15] python: Add 'fh' to known-good variable names |
Date: |
Wed, 21 Oct 2020 14:51:59 -0400 |
fd and fh are fine: we often use these for "file descriptor" or "file
handle" accordingly. It is rarely the case that you need to enforce a
more semantically meaningful name beyond "This is the file we are using
right now."
While we're here: add comments for all of the non-standard pylint
names. (And the underscore.)
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/setup.cfg | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/python/setup.cfg b/python/setup.cfg
index 506944ef6b..58cf48aaed 100755
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -56,9 +56,10 @@ good-names=i,
k,
ex,
Run,
- _,
- fd,
- c,
+ _, # By convention: Unused variable
+ fh, # fh = open(...)
+ fd, # fd = os.open(...)
+ c, # for c in string: ...
[pylint.similarities]
# Ignore imports when computing similarities.
--
2.26.2
- Re: [PATCH 03/15] scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/, (continued)
- [PATCH 10/15] scripts/qom-fuse: use QOMCommand.qom_list(), John Snow, 2020/10/21
- [PATCH 13/15] scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py, John Snow, 2020/10/21
- [PATCH 08/15] scripts/qom-fuse: Add docstrings, John Snow, 2020/10/21
- [PATCH 07/15] scripts/qom-fuse: Apply pylint rules, John Snow, 2020/10/21
- [PATCH 12/15] scripts/qom-fuse: add static type hints, John Snow, 2020/10/21
- [PATCH 11/15] scripts/qom-fuse: ensure QOMFuse.read always returns bytes, John Snow, 2020/10/21
- [PATCH 06/15] python: Add 'fh' to known-good variable names,
John Snow <=
- [PATCH 01/15] python/qmp: Add qom script rewrites, John Snow, 2020/10/21
- [PATCH 02/15] python/qmp: add qom script entry points, John Snow, 2020/10/21
- [PATCH 04/15] scripts/qom-fuse: apply isort rules, John Snow, 2020/10/21
- [PATCH 09/15] scripts/qom-fuse: Convert to QOMCommand, John Snow, 2020/10/21
- [PATCH 15/15] python: add fuse command to 'qom' tools, John Snow, 2020/10/21
- [PATCH 14/15] scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py, John Snow, 2020/10/21
- [PATCH 05/15] scripts/qom-fuse: apply flake8 rules, John Snow, 2020/10/21