From 40fb7430db25a833a4d5134c0b3a66126a0cc07e Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Thu, 2 Mar 2023 05:01:13 +0300 Subject: [PATCH] lint: enable flake8-simplify --- pyproject.toml | 9 +++++---- tools/ratbagc.py.in | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b352d26d..00a98bb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,13 +21,14 @@ select = [ # `Error` suffix on exception names. "N818", # flake8-simplify - # Use 'key in dict' instead of 'key in dict.keys()'. - "SIM118", - # Use 'a != b' instead of 'not a == b'. - "SIM201", + "SIM", ] ignore = [ # Line too long. # We have some places where it's just impossible to make it fit. "E501", + # Use 'contextlib.suppress(...)' instead of try-except-pass. + # I think it's better to use integrated language constructs instead + # of libraries. + "SIM105", ] diff --git a/tools/ratbagc.py.in b/tools/ratbagc.py.in index 1bf2f5ae..b442b871 100644 --- a/tools/ratbagc.py.in +++ b/tools/ratbagc.py.in @@ -168,7 +168,7 @@ class Ratbagd: v = libratbag.ratbag_log_get_priority(self._ratbag) if v == libratbag.RATBAG_LOG_PRIORITY_RAW: return 3 - elif v == libratbag.RATBAG_LOG_PRIORITY_DEBUG: + elif v == libratbag.RATBAG_LOG_PRIORITY_DEBUG: # noqa: SIM114 # to match with setter action, we return 1 instead of 2 return 1 elif v == libratbag.RATBAG_LOG_PRIORITY_INFO: