Skip to content

Commit

Permalink
linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GinzburgLev committed Jan 27, 2025
1 parent 3d8243d commit c57d751
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pynxtools/dataconverter/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ def check_attributes_of_nonexisting_field() -> list:
keys_to_remove = []

for key in mapping:
last_index=key.rfind("/")
if key[last_index+1] == "@":
last_index = key.rfind("/")
if key[last_index + 1] == "@":
# key is an attribute. Find a corresponding parent, check all the other children of this parent
attribute_parent_checked = False
# True if found the value (so, the parent is a field) or non-attribute children (so the parent is a group)
Expand All @@ -574,14 +574,16 @@ def check_attributes_of_nonexisting_field() -> list:
# the parent is a field
attribute_parent_checked = True
break
elif key_iterating[last_index+1] != "@":
elif key_iterating[last_index + 1] != "@":
# the parent is a group
attribute_parent_checked = True
break
if not attribute_parent_checked:
keys_to_remove.append(key)
collector.collect_and_log(
key[0:last_index], ValidationProblem.AttributeForNonExistingField, None
key[0:last_index],
ValidationProblem.AttributeForNonExistingField,
None,
)
return keys_to_remove

Expand Down

0 comments on commit c57d751

Please sign in to comment.