-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Context
At places like
PHP_CodeSniffer/src/Reports/Code.php
Line 169 in 7566b4d
| echo $file; |
we report the full file location.
basepath is a config property that can be used to remove it, but doesn't fully work for this.In our pipelines we have another path then in develop. And not every developer has the same prefix, nginx/apache locations vary.
So supporting multiple is needed to fix this for us.
To reproduce
In an apache docker container
php cbf
And see a File with /var/www/html/...
In a nginx container /usr/share/nginx/html/...
On bitbucket pipelines /opt/atlassian/pipelines/agent/build/...
The set to support is for us these 3, but currently unable to fix this natively
Work around
is use | sed and remove this prefix, but the substring process makes this process not reliable.
PHP_CodeSniffer/src/Reports/Code.php
Line 171 in 7566b4d
| echo '...'.substr($file, ($fileLength - ($width - 6))); |
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
masterbranch of PHP_CodeSniffer.