phpcompat icon indicating copy to clipboard operation
phpcompat copied to clipboard

False positive on unused vendor file

Open moorscode opened this issue 5 years ago • 3 comments

Hi!

We received an issue from a user who ran the plugin over the latest released version of Yoast SEO (9.2.1).

In this version we have included some additional packages which run when the plugin is not installed with composer (most cases of course). In one of these packages there is a file that uses the deprecated sqlite extension, this is only used conditionally, and we do not intent to use that condition.

How can we resolve this problem? Is there a way to add an exclusion for this specific case?

Related issue: https://github.com/Yoast/wordpress-seo/issues/11798

moorscode avatar Dec 12 '18 08:12 moorscode

@moorscode Not sure, but would be worth checking if the phpcompat plugin will respect // phpcs:ignore PHPCompatibility.Cat.Sniff annotations and if so, it might be worth it to see if such an annotation can be added to that package.

jrfnl avatar Dec 12 '18 10:12 jrfnl

I think that we could use filter phpcompat_whitelist. It's probably the fastest way and maybe I could create PR for Yoast SEO. Other way is adding // @codingStandardsIgnoreLine (I think that php-compatibility-checker uses older code sniffer) in Ruckusing.

stodorovic avatar Dec 12 '18 11:12 stodorovic

@stodorovic that would be great.

I rather not do any changes in the package itself if it can be avoided, so adding the filter sounds like the desired approach.

moorscode avatar Dec 12 '18 16:12 moorscode