[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/72] python: Add 'fh' to known-good variable names
From: |
John Snow |
Subject: |
[PULL 09/72] python: Add 'fh' to known-good variable names |
Date: |
Fri, 18 Jun 2021 19:03:52 -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>
Message-id: 20210603003719.1321369-10-jsnow@redhat.com
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 a19029d538..c9b9445af9 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
- [PULL 00/72] Python patches, John Snow, 2021/06/18
- [PULL 02/72] python/qmp: Fix type of SocketAddrT, John Snow, 2021/06/18
- [PULL 05/72] python/qmp: add qom script entry points, John Snow, 2021/06/18
- [PULL 07/72] scripts/qom-fuse: apply isort rules, John Snow, 2021/06/18
- [PULL 12/72] scripts/qom-fuse: Convert to QOMCommand, John Snow, 2021/06/18
- [PULL 14/72] scripts/qom-fuse: ensure QOMFuse.read always returns bytes, John Snow, 2021/06/18
- [PULL 06/72] scripts/qmp: redirect qom-xxx scripts to python/qemu/qmp/, John Snow, 2021/06/18
- [PULL 09/72] python: Add 'fh' to known-good variable names,
John Snow <=
- [PULL 17/72] scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py, John Snow, 2021/06/18
- [PULL 01/72] python/pipenv: Update Pipfile.lock, John Snow, 2021/06/18
- [PULL 08/72] scripts/qom-fuse: apply flake8 rules, John Snow, 2021/06/18
- [PULL 15/72] scripts/qom-fuse: add static type hints, John Snow, 2021/06/18
- [PULL 11/72] scripts/qom-fuse: Add docstrings, John Snow, 2021/06/18
- [PULL 16/72] python: add optional FUSE dependencies, John Snow, 2021/06/18
- [PULL 30/72] scripts/qemu-ga-client: Add forwarder shim, John Snow, 2021/06/18
- [PULL 35/72] scripts/qmp-shell: fix connect method signature, John Snow, 2021/06/18
- [PULL 32/72] scripts/qmp-shell: Apply flake8 rules, John Snow, 2021/06/18
- [PULL 38/72] scripts/qmp-shell: Use python3-style super(), John Snow, 2021/06/18