ci: check syntax via php first
This commit is contained in:
parent
897804cef2
commit
3923815580
3 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
phpmd:
|
phpmd:
|
||||||
image: php:5.6
|
image: php:5.6
|
||||||
script:
|
script:
|
||||||
|
- sh utils/php-lint.sh
|
||||||
- curl -o /usr/bin/phpmd -L http://static.phpmd.org/php/2.6.0/phpmd.phar
|
- curl -o /usr/bin/phpmd -L http://static.phpmd.org/php/2.6.0/phpmd.phar
|
||||||
- chmod +x /usr/bin/phpmd
|
- chmod +x /usr/bin/phpmd
|
||||||
- sh utils/gitlab-ci/phpmd.sh
|
- sh utils/gitlab-ci/phpmd.sh
|
||||||
|
|
3
utils/gitlab-ci/php-lint.sh
Normal file
3
utils/gitlab-ci/php-lint.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
exec find . -name "*.php" -not -path "*/lib/*" -print0 | xargs -0 -n1 php -l
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -i -e
|
||||||
|
|
||||||
#phpmd include text utils/gitlab-ci/phpmd-ruleset.xml
|
#phpmd include text utils/gitlab-ci/phpmd-ruleset.xml
|
||||||
#phpmd classes text utils/gitlab-ci/phpmd-ruleset.xml
|
#phpmd classes text utils/gitlab-ci/phpmd-ruleset.xml
|
||||||
|
|
||||||
FILES=$(ls -dm *.php | tr -d " "| tr -d "\n")
|
FILES=$(ls -dm *.php | tr -d " "| tr -d "\n")
|
||||||
phpmd $FILES text utils/gitlab-ci/phpmd-ruleset.xml
|
phpmd $FILES text utils/gitlab-ci/phpmd-ruleset.xml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue