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