Skip to content

Commit 5b46abc

Browse files
committed
Apply format
1 parent 5bd069d commit 5b46abc

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

src/specfact_cli/adapters/ado.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,22 +565,28 @@ def export_artifact(
565565
target_org = target_repo.split("/")[0] if "/" in target_repo else None
566566
entry_project = entry_repo.split("/", 1)[1] if "/" in entry_repo else None
567567
target_project = target_repo.split("/", 1)[1] if "/" in target_repo else None
568-
568+
569569
# Only use org-only match when:
570570
# 1. Org matches
571571
# 2. source_id exists
572572
# 3. AND (project is unknown in entry OR project is unknown in target OR both contain GUIDs)
573573
# This prevents matching org/project-a with org/project-b when both have known project names
574574
source_url = entry.get("source_url", "")
575-
entry_has_guid = source_url and re.search(r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE)
575+
entry_has_guid = source_url and re.search(
576+
r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE
577+
)
576578
project_unknown = (
577579
not entry_project # Entry has no project part
578580
or not target_project # Target has no project part
579581
or entry_has_guid # Entry URL contains GUID (project name unknown)
580-
or (entry_project and len(entry_project) == 36 and "-" in entry_project) # Entry project is a GUID
581-
or (target_project and len(target_project) == 36 and "-" in target_project) # Target project is a GUID
582+
or (
583+
entry_project and len(entry_project) == 36 and "-" in entry_project
584+
) # Entry project is a GUID
585+
or (
586+
target_project and len(target_project) == 36 and "-" in target_project
587+
) # Target project is a GUID
582588
)
583-
589+
584590
if (
585591
entry_org
586592
and target_org

src/specfact_cli/sync/bridge_sync.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,22 +1439,28 @@ def _find_source_tracking_entry(
14391439
target_org = target_repo.split("/")[0] if "/" in target_repo else None
14401440
entry_project = entry_repo.split("/", 1)[1] if "/" in entry_repo else None
14411441
target_project = target_repo.split("/", 1)[1] if "/" in target_repo else None
1442-
1442+
14431443
# Only use org-only match when:
14441444
# 1. Org matches
14451445
# 2. source_id exists (for single dict, check source_tracking dict)
14461446
# 3. AND (project is unknown in entry OR project is unknown in target OR both contain GUIDs)
14471447
# This prevents matching org/project-a with org/project-b when both have known project names
14481448
source_url = source_tracking.get("source_url", "") if isinstance(source_tracking, dict) else ""
1449-
entry_has_guid = source_url and re.search(r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE)
1449+
entry_has_guid = source_url and re.search(
1450+
r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE
1451+
)
14501452
project_unknown = (
14511453
not entry_project # Entry has no project part
14521454
or not target_project # Target has no project part
14531455
or entry_has_guid # Entry URL contains GUID (project name unknown)
1454-
or (entry_project and len(entry_project) == 36 and "-" in entry_project) # Entry project is a GUID
1455-
or (target_project and len(target_project) == 36 and "-" in target_project) # Target project is a GUID
1456+
or (
1457+
entry_project and len(entry_project) == 36 and "-" in entry_project
1458+
) # Entry project is a GUID
1459+
or (
1460+
target_project and len(target_project) == 36 and "-" in target_project
1461+
) # Target project is a GUID
14561462
)
1457-
1463+
14581464
if (
14591465
entry_org
14601466
and target_org
@@ -1511,22 +1517,28 @@ def _find_source_tracking_entry(
15111517
target_org = target_repo.split("/")[0] if "/" in target_repo else None
15121518
entry_project = entry_repo.split("/", 1)[1] if "/" in entry_repo else None
15131519
target_project = target_repo.split("/", 1)[1] if "/" in target_repo else None
1514-
1520+
15151521
# Only use org-only match when:
15161522
# 1. Org matches
15171523
# 2. source_id exists
15181524
# 3. AND (project is unknown in entry OR project is unknown in target OR both contain GUIDs)
15191525
# This prevents matching org/project-a with org/project-b when both have known project names
15201526
source_url = entry.get("source_url", "")
1521-
entry_has_guid = source_url and re.search(r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE)
1527+
entry_has_guid = source_url and re.search(
1528+
r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}", source_url, re.IGNORECASE
1529+
)
15221530
project_unknown = (
15231531
not entry_project # Entry has no project part
15241532
or not target_project # Target has no project part
15251533
or entry_has_guid # Entry URL contains GUID (project name unknown)
1526-
or (entry_project and len(entry_project) == 36 and "-" in entry_project) # Entry project is a GUID
1527-
or (target_project and len(target_project) == 36 and "-" in target_project) # Target project is a GUID
1534+
or (
1535+
entry_project and len(entry_project) == 36 and "-" in entry_project
1536+
) # Entry project is a GUID
1537+
or (
1538+
target_project and len(target_project) == 36 and "-" in target_project
1539+
) # Target project is a GUID
15281540
)
1529-
1541+
15301542
if (
15311543
entry_org
15321544
and target_org

0 commit comments

Comments
 (0)