Skip to content

Commit 20dceed

Browse files
committed
checks: bugfix id contains feature
- separate feature in single parts - search for each part individually
1 parent 21f2c40 commit 20dceed

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/extensions/score_metamodel/checks/id_contains_feature.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def id_contains_feature(app: Sphinx, need: NeedsInfoType, log: CheckLogger):
3737

3838
# Get the part of the string after the first two underscores: the path
3939
feature = parts[1]
40+
featureparts = feature.split("_")
4041

4142
dir_docname = os.path.dirname(str(need.get("docname", "")))
4243

@@ -45,7 +46,12 @@ def id_contains_feature(app: Sphinx, need: NeedsInfoType, log: CheckLogger):
4546
# NOTE: This does not match the process requirements
4647
docname = dir_docname if dir_docname else need.get("docname", "")
4748

48-
if feature not in docname:
49+
found = False
50+
for featurepart in featureparts:
51+
if featurepart in docname:
52+
found = True
53+
54+
if not found:
4955
log.warning_for_option(
5056
need, "id", f"Feature '{feature}' not in path '{docname}'."
5157
)

0 commit comments

Comments
 (0)