Skip to content

Commit f6259ba

Browse files
matttbekuba-moo
authored andcommitted
tools: ynl: check for membership with 'not in'
It is better to use 'not in' instead of 'not {element} in {collection}' according to Ruff. This is linked to Ruff error E713 [1]: Testing membership with {element} not in {collection} is more readable. Link: https://docs.astral.sh/ruff/rules/not-in-test/ [1] Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Asbjørn Sloth Tønnesen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 10d32b0 commit f6259ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/net/ynl/pyynl/ynl_gen_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ def _attr_typol(self):
638638
return '.type = YNL_PT_BITFIELD32, '
639639

640640
def _attr_policy(self, policy):
641-
if not 'enum' in self.attr:
641+
if 'enum' not in self.attr:
642642
raise Exception('Enum required for bitfield32 attr')
643643
enum = self.family.consts[self.attr['enum']]
644644
mask = enum.get_mask(as_flags=True)

0 commit comments

Comments
 (0)