mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Framework: improve style-model pass
This commit is contained in:
@@ -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
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user