Skip to content

Commit 773b662

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5939df1 commit 773b662

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

sphinx_needs/directives/need.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,7 @@ def create_back_links(needs: NeedsMutable, config: NeedsSphinxConfig) -> None:
445445

446446
# Handling of links to need_parts inside a need
447447
if need_id_part and need_id_part in back_need["parts"]:
448-
if (
449-
option_back
450-
not in back_need["parts"][need_id_part]
451-
):
448+
if option_back not in back_need["parts"][need_id_part]:
452449
back_need["parts"][need_id_part][option_back] = [] # type: ignore[literal-required]
453450

454451
back_need["parts"][need_id_part][option_back].append( # type: ignore[literal-required]

sphinx_needs/roles/need_outgoing.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ def process_need_outgoing(
4949
need_id_main, need_id_part = split_need_id(need_id_full)
5050

5151
# If the need target exists, let's create the reference
52-
if (need_id_main in needs_all_needs and not need_id_part) or (
53-
need_id_part
54-
and need_id_main in needs_all_needs
55-
and need_id_part in needs_all_needs[need_id_main]["parts"]
56-
) or (need_id_full in needs_all_needs):
52+
if (
53+
(need_id_main in needs_all_needs and not need_id_part)
54+
or (
55+
need_id_part
56+
and need_id_main in needs_all_needs
57+
and need_id_part in needs_all_needs[need_id_main]["parts"]
58+
)
59+
or (need_id_full in needs_all_needs)
60+
):
5761
try:
5862
if need_id_main in needs_all_needs:
5963
target_need = needs_all_needs[need_id_main]

0 commit comments

Comments
 (0)