summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-28 10:08:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-28 11:03:04 +0200
commit4bee6880c6537abdd02af2593914f3a41c0db914 (patch)
treecd2bece3f214957672368084dfc8146cec6bc1e6
parentspec: Fix format (diff)
downloadrtems-central-4bee6880c6537abdd02af2593914f3a41c0db914.tar.bz2
specview.py: Improve item validation
-rwxr-xr-xspecview.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/specview.py b/specview.py
index 21cf1000..f8d4b3c3 100755
--- a/specview.py
+++ b/specview.py
@@ -177,6 +177,17 @@ _VALIDATION_LEAF = [
"interface/enum", "interface/enumerator"
]
+_NOT_PRE_QUALIFIED = set([
+ "/acfg/constraint/option-not-pre-qualified",
+ "/constraint/directive-not-pre-qualified",
+])
+
+
+def _is_pre_qualified(item: Item) -> bool:
+ return not bool(
+ set(parent.uid for parent in item.parents("constraint")).intersection(
+ _NOT_PRE_QUALIFIED))
+
def _no_validation(item: Item, path: List[str]) -> List[str]:
path_2 = path + [item.uid]
@@ -189,7 +200,7 @@ def _no_validation(item: Item, path: List[str]) -> List[str]:
for parent in item.parents(_PARENT_ROLES):
path_2 = _no_validation(parent, path_2)
leaf = False
- if leaf and item.type not in _VALIDATION_LEAF:
+ if leaf and item.type not in _VALIDATION_LEAF and _is_pre_qualified(item):
for index, component in enumerate(path_2):
if component:
print(f"{' ' * index}{component}")