Cleanup: make format #106470

Closed
Habib Gahbiche wants to merge 1 commits from zazizizou:cleanup-make-format into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 356 additions and 249 deletions

File diff suppressed because it is too large Load Diff

View File

@ -221,7 +221,7 @@ def cmake_cache_var(var: str) -> Optional[str]:
with open(os.path.join(CMAKE_DIR, "CMakeCache.txt"), encoding='utf-8') as cache_file:
lines = [
l_strip for l in cache_file
if (l_strip := l.strip())
if (l_strip :=l.strip())
if not l_strip.startswith(("//", "#"))
]

View File

@ -94,7 +94,7 @@ if USE_SHARED_RNA_ENUM_ITEMS_STATIC:
for key, enum_items in rna_enum_dict.items()
# It's possible the first item is a heading (which has no identifier).
# skip these as the `EnumProperty.enum_items` does not expose them.
if (enum_prop := next(iter(enum_prop for enum_prop in enum_items if enum_prop.identifier), None))
if (enum_prop: = next(iter(enum_prop for enum_prop in enum_items if enum_prop.identifier), None))
}
@ -1369,7 +1369,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
# Write a link to the enum if this is part of `rna_enum_pointer_map`.
if USE_SHARED_RNA_ENUM_ITEMS_STATIC:
if (result := pyrna_enum2sphinx_shared_link(prop)) is not None:
if (result: = pyrna_enum2sphinx_shared_link(prop)) is not None:
return result
if use_empty_descriptions:
@ -2188,8 +2188,8 @@ def pyrna_enum2sphinx_shared_link(prop):
"""
if (
(prop.type == "enum") and
(pointer := prop.enum_pointer) and
(identifier := rna_enum_pointer_to_id_map.get(pointer))
(pointer: = prop.enum_pointer) and
(identifier: = rna_enum_pointer_to_id_map.get(pointer))
):
return ":ref:`%s`" % identifier
return None

View File

@ -301,7 +301,7 @@ def main() -> None:
# Comparing a pretty printed string tends to give more useful
# text output compared to the data-structure. Both will work.
if (cmp_message := report_humanly_readable_difference(
if (cmp_message: = report_humanly_readable_difference(
pprint.pformat(data_orig, indent=0, width=120),
pprint.pformat(data_reimport, indent=0, width=120),
)):