mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-25 04:23:38 +01:00
Merge pull request #1835 from bantu/task/code-sniffer
[task/code-sniffer] Require PHP Code Sniffer to pass
This commit is contained in:
commit
d437f1f133
16
.travis.yml
16
.travis.yml
@ -10,21 +10,23 @@ env:
|
|||||||
- DB=mysql
|
- DB=mysql
|
||||||
- DB=postgres
|
- DB=postgres
|
||||||
|
|
||||||
before_script:
|
install:
|
||||||
- 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' = 'mariadb' ]; then travis/setup-mariadb.sh; fi"
|
- 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
|
- travis/install-php-extensions.sh
|
||||||
- cd phpBB
|
- cd phpBB
|
||||||
- php ../composer.phar install --dev --no-interaction --prefer-source
|
- php ../composer.phar install --dev --no-interaction --prefer-source
|
||||||
- cd ..
|
- 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
|
- cd build
|
||||||
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi"
|
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi"
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
||||||
script:
|
|
||||||
- phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
|
- phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -75,6 +75,13 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sniff">
|
<target name="sniff">
|
||||||
|
<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
|
<exec command="phpBB/vendor/bin/phpcs
|
||||||
-s
|
-s
|
||||||
--extensions=php
|
--extensions=php
|
||||||
@ -88,14 +95,7 @@
|
|||||||
--ignore=phpBB/phpbb/*
|
--ignore=phpBB/phpbb/*
|
||||||
--ignore=phpBB/vendor/*
|
--ignore=phpBB/vendor/*
|
||||||
phpBB"
|
phpBB"
|
||||||
dir="." passthru="true" />
|
dir="." checkreturn="true" 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" />
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="docs">
|
<target name="docs">
|
||||||
|
@ -7,9 +7,7 @@
|
|||||||
|
|
||||||
<!-- The body of each structure MUST be enclosed by braces. -->
|
<!-- The body of each structure MUST be enclosed by braces. -->
|
||||||
<rule ref="Generic.ControlStructures.InlineControlStructure" />
|
<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. -->
|
<!-- Class constants MUST be declared in all upper case with underscore separators. -->
|
||||||
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
||||||
|
|
||||||
|
@ -24,13 +24,13 @@
|
|||||||
|
|
||||||
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
||||||
|
|
||||||
<!-- There MUST NOT be whitespace before the first content of a file -->
|
<!-- There MUST NOT be whitespace before the first content of a file -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
|
||||||
|
|
||||||
<!-- There MUST NOT be whitespace after the last content of a file -->
|
<!-- There MUST NOT be whitespace after the last content of a file -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
|
||||||
|
|
||||||
<!-- Functions MUST NOT contain multiple empty lines in a row -->
|
<!-- Functions MUST NOT contain multiple empty lines in a row -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user