summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2023-10-15 16:45:22 +1300
committertoofar <toofar@spalge.com>2023-10-15 16:45:22 +1300
commita927a93d2833de61cdf85defb88b94ef8e17d51b (patch)
tree4dad2f826a04b71a9c6170bd0345f8e7ffce76a2
parent207de5828decfa54217b06905e00f9d298f27e57 (diff)
downloadqutebrowser-a927a93d2833de61cdf85defb88b94ef8e17d51b.tar.gz
qutebrowser-a927a93d2833de61cdf85defb88b94ef8e17d51b.zip
lint: allow comparing variables to 0
With pylint 3 there is a new option: https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/use-implicit-booleaness-not-comparison-to-zero.html It's disabled by default but we enable all warnings and disabled them as desired. This one is of the opinion that: if x == 0: is bad and if x: is good. I feel that the first one (x == 0) is more clear. We aren't checking for truthiness here, we are checking for a literal value, its very intentional. One might argue that being precious about making the type here is redundant in current year with type checking tooling and all that. But there are like a hundred of these checks in the code base so it seems a well established pattern anyhow. In summary, the new warning doesn't have a very strong use case and we would prefer to stick with out established pattern.
-rw-r--r--.pylintrc1
1 files changed, 1 insertions, 0 deletions
diff --git a/.pylintrc b/.pylintrc
index 46a8ae2e8..a6784c0e4 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -59,6 +59,7 @@ disable=locally-disabled,
useless-param-doc,
wrong-import-order, # doesn't work with qutebrowser.qt, even with known-third-party set
ungrouped-imports, # ditto
+ use-implicit-booleaness-not-comparison-to-zero,
[BASIC]
function-rgx=[a-z_][a-z0-9_]{2,50}$