[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/19] python: Add 'fh' to known-good variable names
From: |
John Snow |
Subject: |
[PATCH v3 09/19] python: Add 'fh' to known-good variable names |
Date: |
Wed, 2 Jun 2021 20:37:09 -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 a19029d5388..c9b9445af98 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -78,9 +78,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.31.1
- [PATCH v3 03/19] python/qmp: add parse_address classmethod, (continued)
- [PATCH v3 03/19] python/qmp: add parse_address classmethod, John Snow, 2021/06/02
- [PATCH v3 02/19] python/qmp: Fix type of SocketAddrT, John Snow, 2021/06/02
- [PATCH v3 01/19] python/pipenv: Update Pipfile.lock, John Snow, 2021/06/02
- [PATCH v3 05/19] python/qmp: add qom script entry points, John Snow, 2021/06/02
- [PATCH v3 04/19] python/qmp: Add qom script rewrites, John Snow, 2021/06/02
- [PATCH v3 06/19] scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/, John Snow, 2021/06/02
- [PATCH v3 07/19] scripts/qom-fuse: apply isort rules, John Snow, 2021/06/02
- [PATCH v3 08/19] scripts/qom-fuse: apply flake8 rules, John Snow, 2021/06/02
- [PATCH v3 09/19] python: Add 'fh' to known-good variable names,
John Snow <=
- [PATCH v3 10/19] scripts/qom-fuse: Apply pylint rules, John Snow, 2021/06/02
- [PATCH v3 11/19] scripts/qom-fuse: Add docstrings, John Snow, 2021/06/02
- [PATCH v3 12/19] scripts/qom-fuse: Convert to QOMCommand, John Snow, 2021/06/02
- [PATCH v3 13/19] scripts/qom-fuse: use QOMCommand.qom_list(), John Snow, 2021/06/02
- [PATCH v3 14/19] scripts/qom-fuse: ensure QOMFuse.read always returns bytes, John Snow, 2021/06/02
- [PATCH v3 15/19] scripts/qom-fuse: add static type hints, John Snow, 2021/06/02
- [PATCH v3 16/19] python: add optional FUSE dependencies, John Snow, 2021/06/02
- [PATCH v3 17/19] scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py, John Snow, 2021/06/02
- [PATCH v3 19/19] python/qmp: add fuse command to 'qom' tools, John Snow, 2021/06/02