Last modified: 2013-10-22 09:33:32 UTC
From https://integration.wikimedia.org/ci/job/mwext-cldr-phpcs-strict/1/console: 11:21:52 FILE: ...nkins-slave/workspace/mwext-cldr-phpcs-strict/CldrNames/CldrNamesMy.php 11:21:52 643 | ERROR | Line exceeds maximum limit of 120 characters; contains 162 11:21:52 648 | WARNING | Line exceeds 100 characters; contains 109 characters These are the lines in question: 'UM' => 'ယူနိုက်တက်စတိတ် အပြင်ထွက် နေသည့် သေးငယ်သောကျွန်းများ', 'VC' => 'စိန့်ဗင့်ဆင့်နှင့် သည်ဂရဲနာဒင်းစ်', Assuming tab width is 4, the line lengths are 67 and 48 respectively.
phpcs defaults to iso-8859-1 defined in PHP_CODESNIFFER_ENCODING CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php uses strlen(), whenever the encoding is not iso-8859-1 it would use: iconv_strlen($lineContent, PHP_CODESNIFFER_ENCODING); So need to pass: --encoding=UTF-8
Our PHP files should be UTF-8 encoded, so we should run CodeSniffer in that mode. I'll see if I can submit a patch...
Change 88743 had a related patch set uploaded by Siebrand: Specify encoding of source files as utf-8 https://gerrit.wikimedia.org/r/88743
Change 88743 merged by jenkins-bot: Specify encoding of source files as utf-8 https://gerrit.wikimedia.org/r/88743
Have the jobs been pushed? The change is merged but in https://integration.wikimedia.org/ci/job/mwext-VisualEditor-phpcs-HEAD/1524/console I don't see --encoding being passed.
(In reply to comment #5) > Have the jobs been pushed? The change is merged but in > https://integration.wikimedia.org/ci/job/mwext-VisualEditor-phpcs-HEAD/1524/ > console > I don't see --encoding being passed. Good catch Timo. Something went wrong when I refreshed the jobs :( Refreshing them: $ grep 'encoding=utf' /var/lib/jenkins/jobs/*phpcs*/config.xml /var/lib/jenkins/jobs/mwext-AbuseFilter-phpcs-HEAD/config.xml: --encoding=utf-8 \ /var/lib/jenkins/jobs/mwext-ActiveAbstract-phpcs-HEAD/config.xml: --encoding=ut-8 \ /var/lib/jenkins/jobs/mwext-AdminLinks-phpcs-HEAD/config.xml: --encoding=utf-8 \
All jobs got refreshed. That should fix the issue now, if that is actually the case I guess we can close the bug report.
I have retriggered the original build: https://integration.wikimedia.org/ci/job/mwext-cldr-phpcs-strict/4/console The phpcs command being run is: phpcs -v -s . --encoding=utf-8 \ --standard=/var/lib/jenkins/tools/mwcodesniffer/MediaWiki \ --extensions=php,php5,inc,sample \ '--ignore=languages/messages/Messages,*.i18n.php,*.i18n.alias.php' \ --report-checkstyle=checkstyle-phpcs.xml \ --report-full And the result is a SUCCESS. So the fix was indeed to pass '--encoding=utf-8' to phpcs :-]