aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 02:09:32 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 02:09:32 +0200
commitfdcc544ae6af95317f05d34908f01e0541d2ae7c (patch)
tree129c035f79148c576a68933a3fd0f24aba7e847e
parent32a2c95f903cbbfad909945887a1cbabd84d5039 (diff)
parentddb35531ac0c6bba1505f2f84f0010239feea3d7 (diff)
downloadforums-fdcc544ae6af95317f05d34908f01e0541d2ae7c.tar
forums-fdcc544ae6af95317f05d34908f01e0541d2ae7c.tar.gz
forums-fdcc544ae6af95317f05d34908f01e0541d2ae7c.tar.bz2
forums-fdcc544ae6af95317f05d34908f01e0541d2ae7c.tar.xz
forums-fdcc544ae6af95317f05d34908f01e0541d2ae7c.zip
Merge pull request #1 from bantu/ticket/12723
Ticket/12723
-rw-r--r--build/build.xml13
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php5
-rw-r--r--build/code_sniffer/ruleset-php-extensions.xml8
-rw-r--r--build/code_sniffer/ruleset-php-legacy-core.xml11
-rw-r--r--build/code_sniffer/ruleset-php-strict-core.xml9
-rw-r--r--build/code_sniffer/ruleset-phpbb-php-legacy.xml13
-rw-r--r--build/code_sniffer/ruleset-phpbb-php-strict.xml9
7 files changed, 41 insertions, 27 deletions
diff --git a/build/build.xml b/build/build.xml
index 455a99fb1d..d3489ab607 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -77,16 +77,17 @@
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
- --standard=build/code_sniffer/ruleset-phpbb-php-strict.xml
+ --standard=build/code_sniffer/ruleset-php-strict-core.xml
--ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/*
phpBB/phpbb"
dir="." returnProperty="retval-php-strict" passthru="true" />
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
- --standard=build/code_sniffer/ruleset-phpbb-php-legacy.xml
+ --standard=build/code_sniffer/ruleset-php-legacy-core.xml
--ignore=${project.basedir}/phpBB/cache/*
--ignore=${project.basedir}/phpBB/develop/*
+ --ignore=${project.basedir}/phpBB/ext/*
--ignore=${project.basedir}/phpBB/includes/diff/*.php
--ignore=${project.basedir}/phpBB/includes/sphinxapi.php
--ignore=${project.basedir}/phpBB/includes/utf/data/*
@@ -96,10 +97,18 @@
--ignore=${project.basedir}/phpBB/vendor/*
phpBB"
dir="." returnProperty="retval-php-legacy" passthru="true" />
+ <exec command="phpBB/vendor/bin/phpcs
+ -s
+ --extensions=php
+ --standard=build/code_sniffer/ruleset-php-extensions.xml
+ --ignore=${project.basedir}/phpBB/ext/*/tests/*
+ phpBB/ext"
+ dir="." returnProperty="retval-php-ext" passthru="true" />
<if>
<or>
<not><equals arg1="${retval-php-strict}" arg2="0" /></not>
<not><equals arg1="${retval-php-legacy}" arg2="0" /></not>
+ <not><equals arg1="${retval-php-ext}" arg2="0" /></not>
</or>
<then>
<fail message="PHP Code Sniffer failed." />
diff --git a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
index 1f64467d00..fa7d3b40c1 100644
--- a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
@@ -12,9 +12,8 @@
*/
/**
-* Checks that each source file contains the standard header.
-*
-* Based on Coding Guidelines 1.ii File Header.
+* Checks that each PHP source file contains a valid header as defined by the
+* phpBB Coding Guidelines.
*
* @package code_sniffer
* @author Manuel Pichler <mapi@phpundercontrol.org>
diff --git a/build/code_sniffer/ruleset-php-extensions.xml b/build/code_sniffer/ruleset-php-extensions.xml
new file mode 100644
index 0000000000..2d388103c3
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-extensions.xml
@@ -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>
diff --git a/build/code_sniffer/ruleset-php-legacy-core.xml b/build/code_sniffer/ruleset-php-legacy-core.xml
new file mode 100644
index 0000000000..55f2461a04
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-legacy-core.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Legacy Standard Core">
+
+ <description>phpBB legacy coding standard for PHP files of phpBB core</description>
+
+ <rule ref="./ruleset-php-legacy.xml" />
+
+ <!-- Each file MUST start with a valid header as defined by the Coding Guidelines -->
+ <rule ref="./phpbb/Sniffs/Commenting/FileCommentSniff.php" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-strict-core.xml b/build/code_sniffer/ruleset-php-strict-core.xml
new file mode 100644
index 0000000000..5ca4d0cf1e
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-strict-core.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Strict Standard Core">
+
+ <description>phpBB coding standard for PHP files of phpBB core</description>
+
+ <rule ref="./ruleset-php-legacy-core.xml" />
+ <rule ref="./ruleset-php-strict.xml" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-phpbb-php-legacy.xml b/build/code_sniffer/ruleset-phpbb-php-legacy.xml
deleted file mode 100644
index 9f11ce290e..0000000000
--- a/build/code_sniffer/ruleset-phpbb-php-legacy.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<ruleset name="phpBB PHP Legacy Standard">
-
- <description>phpBB legacy coding standard for PHP files</description>
-
- <rule ref="./ruleset-php-legacy.xml" />
-
- <!-- THe header file MUST contains:
- - the phpBB copyright: (c) phpBB Limited <https://www.phpbb.com>
- - the phpBB License: GNU General Public License, version 2 (GPL-2.0) -->
- <rule ref="./phpbb/Sniffs/Commenting/FileCommentSniff.php" />
-
-</ruleset>
diff --git a/build/code_sniffer/ruleset-phpbb-php-strict.xml b/build/code_sniffer/ruleset-phpbb-php-strict.xml
deleted file mode 100644
index 6da9297099..0000000000
--- a/build/code_sniffer/ruleset-phpbb-php-strict.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<ruleset name="phpBB PHP Legacy Standard">
-
- <description>phpBB legacy coding standard for PHP files</description>
-
- <rule ref="./ruleset-phpbb-php-legacy.xml" />
- <rule ref="./ruleset-php-strict.xml" />
-
-</ruleset>