Framework: add more model linting

This commit is contained in:
Franco Fichtner
2025-07-10 10:13:32 +02:00
parent 07d67b4dea
commit 3093d47fd2
+11
View File
@@ -388,6 +388,17 @@ lint-model:
(xmllint $${MODEL} --xpath '//*[@type and not(@type="ArrayField") and OptionValues[default[not(@value)] or multiple[not(@value)] or required[not(@value)]]]' 2> /dev/null | grep '^<' || true) | while read LINE; do \
echo "$${MODEL}: $${LINE} option element default/multiple/required without value attribute"; \
done; \
(xmllint $${MODEL} --xpath '//*[@type="CSVListField" and Mask and (not(MaskPerItem) or MaskPerItem=N)]' 2> /dev/null | grep '^<' || true) | while read LINE; do \
echo "$${MODEL}: $${LINE} uses Mask regex with MaskPerItem=N"; \
done; \
for TYPE in .\\AliasesField .\\DomainIPField HostnameField IPPortField NetworkField MacAddressField .\\RangeAddressField; do \
(xmllint $${MODEL} --xpath '//*[@type="'$${TYPE}'" and FieldSeparator=","]' 2> /dev/null | grep '^<' || true) | while read LINE; do \
echo "$${MODEL}: $${LINE} FieldSeparator=, is the default"; \
done; \
(xmllint $${MODEL} --xpath '//*[@type="'$${TYPE}'" and AsList="N"]' 2> /dev/null | grep '^<' || true) | while read LINE; do \
echo "$${MODEL}: $${LINE} AsList=N is the default"; \
done; \
done; \
done; fi
ACLBIN?= ${.CURDIR}/../../../core/Scripts/dashboard-acl.sh