mirror of
https://github.com/opnsense/plugins.git
synced 2026-02-03 20:40:37 -05:00
Framework: improve style-model pass
(cherry picked from commit 0f1b8b2666)
This commit is contained in:
parent
4bc725e1b7
commit
bbbe985b47
2 changed files with 11 additions and 7 deletions
2
Makefile
2
Makefile
|
|
@ -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}:
|
||||
|
|
|
|||
|
|
@ -453,12 +453,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 \
|
||||
|
|
|
|||
Loading…
Reference in a new issue