Skip to content

Bug in lint method of the PhpcsLinter class #128

@Blake-C

Description

@Blake-C

If a user has <arg name="basepath" value="./"/> in their phpcs.xml file the dictionary look up on line 216 will lookup the wrong file.

if (filePath !== undefined && semver.gte(this.executableVersion, '2.0.0')) {
	const fileRealPath = extfs.realpathSync(filePath);
	if (!data.files[fileRealPath]) {
		return [];
	}
	({ messages } = data.files[fileRealPath]);
}

File path given with <arg name="basepath" value="./"/>:
screen shot 2018-09-01 at 11 17 04 pm

File path being looked up:
screen shot 2018-09-01 at 11 17 40 pm

Meta:
VSCode: Version 1.26.1 (1.26.1)
macOS: 10.13.6 High Sierra
PHP CodeSniffer: 3.2.3
vscode-phpcs: 1.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions