mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-04 22:33:07 -04:00
add style and style-fix targets
This commit is contained in:
parent
3efe3c46cf
commit
d1885b47e6
3 changed files with 31 additions and 0 deletions
10
Makefile
10
Makefile
|
|
@ -30,3 +30,13 @@ sweep:
|
|||
.for PLUGIN_DIR in ${PLUGIN_DIRS}
|
||||
${MAKE} -C ${PLUGIN_DIR} sweep
|
||||
.endfor
|
||||
|
||||
style:
|
||||
.for PLUGIN_DIR in ${PLUGIN_DIRS}
|
||||
${MAKE} -C ${PLUGIN_DIR} style
|
||||
.endfor
|
||||
|
||||
style-fix:
|
||||
.for PLUGIN_DIR in ${PLUGIN_DIRS}
|
||||
${MAKE} -C ${PLUGIN_DIR} style-fix
|
||||
.endfor
|
||||
|
|
|
|||
|
|
@ -204,4 +204,17 @@ sweep: check
|
|||
! -name "*.ser" -type f -print0 | \
|
||||
xargs -0 -n1 ${.CURDIR}/../../Scripts/cleanfile
|
||||
|
||||
style: check
|
||||
@(phpcs --standard=${.CURDIR}/../../ruleset.xml ${.CURDIR}/src \
|
||||
|| true) > ${.CURDIR}/.style.out
|
||||
@echo -n "Total number of style warnings: "
|
||||
@grep '| WARNING' ${.CURDIR}/.style.out | wc -l
|
||||
@echo -n "Total number of style errors: "
|
||||
@grep '| ERROR' ${.CURDIR}/.style.out | wc -l
|
||||
@cat ${.CURDIR}/.style.out
|
||||
@rm ${.CURDIR}/.style.out
|
||||
|
||||
style-fix: check
|
||||
phpcbf --standard=${.CURDIR}/../../ruleset.xml ${.CURDIR}/src || true
|
||||
|
||||
.PHONY: check
|
||||
|
|
|
|||
8
ruleset.xml
Normal file
8
ruleset.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="PSR2+">
|
||||
<description>Slightly enhanced version of the PSR2 standard</description>
|
||||
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
|
||||
<rule ref="PSR2"/>
|
||||
<exclude-pattern>*.css</exclude-pattern>
|
||||
<exclude-pattern>*.js</exclude-pattern>
|
||||
</ruleset>
|
||||
Loading…
Reference in a new issue