Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 3/6] scripts/test_list.py: fix some hints pointed by Ruff
Date: Tue,  9 May 2023 11:07:35 +0200	[thread overview]
Message-ID: <20230509090738.1157939-4-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230509090738.1157939-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

There are some places where the wrong logic was used to check
for dict members, causing those warnings on Ruff:

	E713 [*] Test for membership should be `not in`

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/test_list.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 7153b06df015..21767870b1c1 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -689,7 +689,7 @@ class TestList:
             marker = 0
             for cur_level in range(0, len(fields_order)):  # pylint: disable=C0200
                 field = fields_order[cur_level]
-                if not "level" in self.props[field]["_properties_"]:
+                if "level" not in self.props[field]["_properties_"]:
                     continue
                 if field in fields:
                     if old_fields[cur_level] != fields[field]:
@@ -698,9 +698,9 @@ class TestList:
 
             # print hierarchy
             for i in range(cur_level, len(fields_order)):
-                if not "level" in self.props[fields_order[i]]["_properties_"]:
+                if "level" not in self.props[fields_order[i]]["_properties_"]:
                     continue
-                if not fields_order[i] in fields:
+                if fields_order[i] not in fields:
                     continue
 
                 if marker >= len(level_markers):
@@ -728,7 +728,7 @@ class TestList:
             # Store current values
             for i in range(cur_level, len(fields_order)):
                 field = fields_order[i]
-                if not "level" in self.props[field]["_properties_"]:
+                if "level" not in self.props[field]["_properties_"]:
                     continue
                 if field in fields:
                     old_fields[i] = fields[field]
-- 
2.40.1

  parent reply	other threads:[~2023-05-09  9:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  9:07 [igt-dev] [PATCH i-g-t v3 0/6] Better document i915 tests Mauro Carvalho Chehab
2023-05-09  9:07 ` [igt-dev] [PATCH i-g-t v3 1/6] scripts/test_list.py: expand testlist fields Mauro Carvalho Chehab
2023-05-16 15:56   ` Kamil Konieczny
2023-05-09  9:07 ` [igt-dev] [PATCH i-g-t v3 2/6] scripts/test_list.py: add support to exclude files Mauro Carvalho Chehab
2023-05-16 15:57   ` Kamil Konieczny
2023-05-09  9:07 ` Mauro Carvalho Chehab [this message]
2023-05-16 16:02   ` [igt-dev] [PATCH i-g-t v3 3/6] scripts/test_list.py: fix some hints pointed by Ruff Kamil Konieczny
2023-05-09  9:07 ` [igt-dev] [PATCH i-g-t v3 4/6] testplan/meson.build: add i915 support for a testplan document Mauro Carvalho Chehab
2023-05-16 16:18   ` Kamil Konieczny
2023-05-09  9:07 ` [igt-dev] [PATCH i-g-t v3 5/6] tests/i915: Improve test documentation Mauro Carvalho Chehab
2023-05-16 16:28   ` Kamil Konieczny
2023-05-16 16:47   ` Kamil Konieczny
2023-05-17  7:25     ` Mauro Carvalho Chehab
2023-05-09  9:07 ` [igt-dev] [PATCH i-g-t v3 6/6] tests/i915: Enhance " Mauro Carvalho Chehab
2023-05-16 18:41   ` Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230509090738.1157939-4-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox