From 6a7db8d51a6659d6684a66d423904c9b7de59adf Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 00:44:04 +0100 Subject: [PATCH 1/4] [task/code-sniffer] Require code sniffer to pass on Travis CI. PHPBB3-11980 --- .travis.yml | 4 ++-- build/build.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd947a72e0..e82e815b3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,11 +20,11 @@ before_script: - 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" + +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..c685a6f516 100644 --- a/build/build.xml +++ b/build/build.xml @@ -88,14 +88,14 @@ --ignore=phpBB/phpbb/* --ignore=phpBB/vendor/* phpBB" - dir="." passthru="true" /> + dir="." checkreturn="true" passthru="true" /> + dir="." checkreturn="true" passthru="true" /> From 92144b370c0a40ed037e5a6fa26445debe79c07a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 01:00:24 +0100 Subject: [PATCH 2/4] [task/code-sniffer] Check phpBB/phpbb first. This is where new files go. PHPBB3-11980 --- build/build.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/build.xml b/build/build.xml index c685a6f516..c033b1fefd 100644 --- a/build/build.xml +++ b/build/build.xml @@ -75,6 +75,13 @@ + - From 5b6608312081624d9b46fce47183c2f65fd0361b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 01:03:53 +0100 Subject: [PATCH 3/4] [task/code-sniffer] Reorganise .travis.yml PHPBB3-11980 --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e82e815b3b..2a80b8ce0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,16 +10,18 @@ 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 From 99fccb6f19e3945156ba74b67602a4a5b88e7434 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 01:36:37 +0100 Subject: [PATCH 4/4] [task/code-sniffer] Cleanup code sniffer ruleset files. PHPBB3-11980 --- build/code_sniffer/ruleset-php-legacy.xml | 4 +--- build/code_sniffer/ruleset-php-strict.xml | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) 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 @@ - - - + 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 @@ - + - +