ruff: Fix SIM102 nested if statements.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-01-17 20:59:37 -05:00
committed by Tim Abbott
parent 50cf9bc4b8
commit b0e569f07c
38 changed files with 333 additions and 327 deletions

View File

@@ -66,19 +66,20 @@ if __name__ == "__main__":
migration_number = file[0:4]
counter = file_index.count(migration_number)
if counter > 1 and file[0:4] not in stack:
if (
counter > 1
and file[0:4] not in stack
# When we need to backport migrations to a previous
# release, we sometimes end up with multiple having
# the same ID number (which isn't a problem; the
# migrations graph structure, not the IDs, is what
# matters).
if migration_number not in MIGRATIONS_TO_SKIP:
conflicts += [
file_name
for file_name in files_list
if file_name.startswith(migration_number)
]
stack.append(migration_number)
and migration_number not in MIGRATIONS_TO_SKIP
):
conflicts += [
file_name for file_name in files_list if file_name.startswith(migration_number)
]
stack.append(migration_number)
if len(conflicts) > 0:
resolve_conflicts(conflicts, files_list)