dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 439 forks source link

php_codesniffer fails, but just in PHPCI. On console it works. #836

Open a-r-m-i-n opened 9 years ago

a-r-m-i-n commented 9 years ago

Hi, I've got a strange issue.

I'm using php_codesniffer (1.5.*) to analyse our code. This works mostly perfect. But now I got in one file this message:

Warning (Line 20): Line exceeds 130 characters; contains 146 characters
Warning (Line 38): Line exceeds 130 characters; contains 145 characters

Error (Line 1): An error occurred during processing; checking has been aborted. The error message was: Token type is not T_FUNCTION, T_CLASS, T_INTERFACE or T_TRAIT

But when I run php_codesniffer on console, the error does not appear:

--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 20 | WARNING | Line exceeds 130 characters; contains 146 characters
 38 | WARNING | Line exceeds 130 characters; contains 145 characters
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------

I've called phpcs with this command (working directory was the folder which contains the related file):

php /var/www/.../htdocs/phpci/vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=TYPO3CMS ./

Do you have any ideas, what the reason could be? I've updated PHPCI to the latest master and performed a composer update, during investigation. The issue still exists.

mavimo commented 9 years ago

Can you try to run phpcs with the same user phpci use?