Framework: improve style-model pass

This commit is contained in:
Franco Fichtner
2025-07-02 10:45:40 +02:00
parent 9a337a87c0
commit 0f1b8b2666
2 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ list:
.endfor
# shared targets that are sane to run from the root directory
TARGETS= clean glint lint plist-fix revision style style-fix style-python sweep test
TARGETS= clean glint lint plist-fix revision style style-fix style-model style-python sweep test
.for TARGET in ${TARGETS}
${TARGET}:
+10 -6
View File
@@ -469,12 +469,16 @@ style-python: check
fi
style-model:
@for MODEL in $$(find ${.CURDIR}/src/opnsense/mvc/app/models -depth 3 \
-name "*.xml"); do \
perl -i -pe 's/<default>(.*?)<\/default>/<Default>$$1<\/Default>/g' $${MODEL}; \
perl -i -pe 's/<multiple>(.*?)<\/multiple>/<Multiple>$$1<\/Multiple>/g' $${MODEL}; \
perl -i -pe 's/<required>(.*?)<\/required>/<Required>$$1<\/Required>/g' $${MODEL}; \
done
@if [ -d ${.CURDIR}/src/opnsense/mvc/app/models ]; then \
for MODEL in $$(find ${.CURDIR}/src/opnsense/mvc/app/models -depth 3 \
-name "*.xml"); do \
perl -i -pe 's/<default>(.*?)<\/default>/<Default>$$1<\/Default>/g' $${MODEL}; \
perl -i -pe 's/<multiple>(.*?)<\/multiple>/<Multiple>$$1<\/Multiple>/g' $${MODEL}; \
perl -i -pe 's/<required>(.*?)<\/required>/<Required>$$1<\/Required>/g' $${MODEL}; \
perl -i -pe 's/<mask>(.*?)<\/mask>/<Mask>$$1<\/Mask>/g' $${MODEL}; \
perl -i -pe 's/<asList>(.*?)<\/asList>/<AsList>$$1<\/AsList>/g' $${MODEL}; \
done; \
fi
test: check
@if [ -d ${.CURDIR}/src/opnsense/mvc/tests ]; then \