[ticket/12757] Add a Code Sniffer ruleset for PHP files of phpBB extensions

PHPBB3-12757
This commit is contained in:
Andreas Fischer 2014-06-22 01:28:29 +02:00
parent 82c43e258b
commit 900a5b07c4
2 changed files with 16 additions and 0 deletions

View file

@ -87,6 +87,7 @@
--standard=build/code_sniffer/ruleset-php-legacy-core.xml --standard=build/code_sniffer/ruleset-php-legacy-core.xml
--ignore=${project.basedir}/phpBB/cache/* --ignore=${project.basedir}/phpBB/cache/*
--ignore=${project.basedir}/phpBB/develop/* --ignore=${project.basedir}/phpBB/develop/*
--ignore=${project.basedir}/phpBB/ext/*
--ignore=${project.basedir}/phpBB/includes/diff/*.php --ignore=${project.basedir}/phpBB/includes/diff/*.php
--ignore=${project.basedir}/phpBB/includes/sphinxapi.php --ignore=${project.basedir}/phpBB/includes/sphinxapi.php
--ignore=${project.basedir}/phpBB/includes/utf/data/* --ignore=${project.basedir}/phpBB/includes/utf/data/*
@ -96,10 +97,17 @@
--ignore=${project.basedir}/phpBB/vendor/* --ignore=${project.basedir}/phpBB/vendor/*
phpBB" phpBB"
dir="." returnProperty="retval-php-legacy" passthru="true" /> dir="." returnProperty="retval-php-legacy" passthru="true" />
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
--standard=build/code_sniffer/ruleset-php-extensions.xml
phpBB/ext"
dir="." returnProperty="retval-php-ext" passthru="true" />
<if> <if>
<or> <or>
<not><equals arg1="${retval-php-strict}" arg2="0" /></not> <not><equals arg1="${retval-php-strict}" arg2="0" /></not>
<not><equals arg1="${retval-php-legacy}" arg2="0" /></not> <not><equals arg1="${retval-php-legacy}" arg2="0" /></not>
<not><equals arg1="${retval-php-ext}" arg2="0" /></not>
</or> </or>
<then> <then>
<fail message="PHP Code Sniffer failed." /> <fail message="PHP Code Sniffer failed." />

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ruleset name="phpBB PHP Strict Standard Extensions">
<description>phpBB coding standard for PHP files of phpBB extensions</description>
<rule ref="./ruleset-php-strict.xml" />
</ruleset>