[TASK] Simplify PHP lint execution 04/38704/3
authorMathias Brodala <mbrodala@pagemachine.de>
Wed, 15 Apr 2015 13:00:58 +0000 (15:00 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Apr 2015 07:33:08 +0000 (09:33 +0200)
This simplifies PHP lint execution in Travis by ensuring lint
errors are outputted to stderr and drops everything else. If
any check fails, the exit code 1 is returned.

The Composer vendor directory is excluded from linting.

Resolves: #66437
Releases: master
Change-Id: I588a880f548c248a0db44f3a3f1274fcec2edd00
Reviewed-on: http://review.typo3.org/38704
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
.travis.yml

index 196b280..45dc256 100644 (file)
@@ -59,12 +59,7 @@ script:
     if [[ "$PHP_LINT" == "yes" ]]; then
         echo;
         echo "Running php lint";
-        /bin/bash -c "
-            if ! find typo3/ -name \*.php | parallel --gnu 'php -l {}' > /tmp/errors 2>&1; then
-                grep -v \"No syntax errors detected in\" /tmp/errors;
-                exit 99;
-            fi
-        "
+        find typo3/ -name \*.php -not -path "typo3/contrib/vendor/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;
     fi
   - >
     if [[ "$XLF_CHECK" == "yes" ]]; then