mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 23:37:39 +02:00
[ticket/12757] Add a Code Sniffer ruleset for PHP files of phpBB extensions
PHPBB3-12757
This commit is contained in:
@@ -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." />
|
||||||
|
8
build/code_sniffer/ruleset-php-extensions.xml
Normal file
8
build/code_sniffer/ruleset-php-extensions.xml
Normal 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>
|
Reference in New Issue
Block a user