Skip to content

Feature Requst: Overwrite File locations #3892

@MakerTim

Description

@MakerTim

Context

At places like


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.

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 master branch of PHP_CodeSniffer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions