aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-10-28 22:59:33 -0700
committerNils Adermann <naderman@naderman.de>2013-10-28 22:59:33 -0700
commitd437f1f133b17568c4bfa1e7e014b29351e9e2ed (patch)
treeb8b1c42680288658272ff4a37a34e7b8f4f83097
parent59e3c2d16e5fa3eb6f1a872657454b437b72ae63 (diff)
parent99fccb6f19e3945156ba74b67602a4a5b88e7434 (diff)
downloadforums-d437f1f133b17568c4bfa1e7e014b29351e9e2ed.tar
forums-d437f1f133b17568c4bfa1e7e014b29351e9e2ed.tar.gz
forums-d437f1f133b17568c4bfa1e7e014b29351e9e2ed.tar.bz2
forums-d437f1f133b17568c4bfa1e7e014b29351e9e2ed.tar.xz
forums-d437f1f133b17568c4bfa1e7e014b29351e9e2ed.zip
Merge pull request #1835 from bantu/task/code-sniffer
[task/code-sniffer] Require PHP Code Sniffer to pass
-rw-r--r--.travis.yml16
-rw-r--r--build/build.xml16
-rw-r--r--build/code_sniffer/ruleset-php-legacy.xml4
-rw-r--r--build/code_sniffer/ruleset-php-strict.xml4
4 files changed, 20 insertions, 20 deletions
diff --git a/.travis.yml b/.travis.yml
index dd947a72e0..2a80b8ce0b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,21 +10,23 @@ env:
- DB=mysql
- DB=postgres
-before_script:
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
+install:
- sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi"
- - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
+ - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
- travis/install-php-extensions.sh
- cd phpBB
- php ../composer.phar install --dev --no-interaction --prefer-source
- cd ..
- - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
+
+before_script:
+ - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
+
+script:
- cd build
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi"
- cd ..
-
-script:
- phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
notifications:
diff --git a/build/build.xml b/build/build.xml
index 9376f95143..c033b1fefd 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -78,6 +78,13 @@
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
+ --standard=build/code_sniffer/ruleset-php-strict.xml
+ --ignore=phpBB/phpbb/db/migration/data/v30x/*
+ phpBB/phpbb"
+ dir="." checkreturn="true" passthru="true" />
+ <exec command="phpBB/vendor/bin/phpcs
+ -s
+ --extensions=php
--standard=build/code_sniffer/ruleset-php-legacy.xml
--ignore=phpBB/cache/*
--ignore=phpBB/develop/*
@@ -88,14 +95,7 @@
--ignore=phpBB/phpbb/*
--ignore=phpBB/vendor/*
phpBB"
- dir="." passthru="true" />
- <exec command="phpBB/vendor/bin/phpcs
- -s
- --extensions=php
- --standard=build/code_sniffer/ruleset-php-strict.xml
- --ignore=phpBB/phpbb/db/migration/data/v30x/*
- phpBB/phpbb"
- dir="." passthru="true" />
+ dir="." checkreturn="true" passthru="true" />
</target>
<target name="docs">
diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml
index ebc85c4fef..ed8c7e98a0 100644
--- a/build/code_sniffer/ruleset-php-legacy.xml
+++ b/build/code_sniffer/ruleset-php-legacy.xml
@@ -7,9 +7,7 @@
<!-- The body of each structure MUST be enclosed by braces. -->
<rule ref="Generic.ControlStructures.InlineControlStructure" />
-
- <!-- All PHP files MUST end with a single blank line. -->
-
+
<!-- Class constants MUST be declared in all upper case with underscore separators. -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml
index 8580090c69..65b6763c57 100644
--- a/build/code_sniffer/ruleset-php-strict.xml
+++ b/build/code_sniffer/ruleset-php-strict.xml
@@ -24,13 +24,13 @@
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
-
+
<!-- There MUST NOT be whitespace before the first content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
<!-- There MUST NOT be whitespace after the last content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
-
+
<!-- Functions MUST NOT contain multiple empty lines in a row -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />