Fatal error when using Gitblame report from subdirectory when ruleset has basepath #3854
Closed
3 tasks done
Labels
Milestone
Describe the bug
When
basepath
is set in a custom ruleset AND PHPCS is subsequently run from within a subdirectory of the project AND theGitblame
report is requested, a fatal error happens.As far as I can see, this is due to the
$filename
which is being passed toGitblame::getBlameContent()
not being the full path to the file, but the path with the basename stripped off.To reproduce
Steps to reproduce the behavior with PHPCS itself:
src
directory of the PHPCS projectphpcs -psl . --report=gitblame
Expected behavior
No fatal error and the
git blame
report is displayed correctlyVersions (please complete the following information)
phpcs.xml.dist
Additional context
This issue is loosely related to #3809.
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: