[igt-dev] [PATCH i-g-t v3 3/6] scripts/test_list.py: fix some hints pointed by Ruff

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue May 16 16:02:28 UTC 2023


On 2023-05-09 at 11:07:35 +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at 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 at kernel.org>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  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
> 


More information about the igt-dev mailing list