You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generic.Files.LineLength will report a line to be over the limit if the line is at limit and contains one or more multibyte characters. This is easily reproducible when having UTF-8 strings in the code base.
Using
echo"Jeg liker blåbærsyltetøy";
Custom ruleset
<?xml version="1.0"?>
<rulesetname="My Custom Standard">
<description>If you are using a custom ruleset, please enter it here.</description>
<ruleref="Generic.Files.LineLength">
<properties>
<propertyname="lineLimit"value="33" />
<propertyname="absoluteLineLimit"value="33" />
</properties>
</rule>
</ruleset>
To reproduce
Steps to reproduce the behavior:
Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
1 | ERROR | [ ] Line exceeds maximum limit of 33 characters; contains 35 characters
Expected behavior
No error. The line only has 32 characters (even though it is 35 bytes long)
Versions (please complete the following information)
Operating System
FreeBSD 13.1
PHP version
PHP 8.2.12
PHP_CodeSniffer version
PHP_CodeSniffer version 3.7.2 (stable)
Standard
custom
Install type
PHAR
Additional context
None I can think og
Please confirm:
I have searched the issue list and am not opening a duplicate issue.
I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
I have verified the issue still exists in the master branch of PHP_CodeSniffer.
The text was updated successfully, but these errors were encountered:
Describe the bug
Generic.Files.LineLength will report a line to be over the limit if the line is at limit and contains one or more multibyte characters. This is easily reproducible when having UTF-8 strings in the code base.
Using
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error. The line only has 32 characters (even though it is 35 bytes long)
Versions (please complete the following information)
Additional context
None I can think og
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: