Hi, I'm using PHP CS in Sublime text 3 with the standard set to Drupal, and everything seems to work well, but the unused use statement sniff doesn't appear to be working, i.e. I never get notices for unused use statements, I was wondering, is there a specific config setting to enable this sniff or should it "just work"?

Comments

justageek created an issue. See original summary.

klausi’s picture

Status: Active » Postponed (maintainer needs more info)

It should just work, what version of Coder are you using? Can you try again with the latest release?

Can you post the a test file where an unused use statement is not found? Then we can debug it and check.

dropa’s picture

Status: Postponed (maintainer needs more info) » Active

Confirming this issue, without modifying extensions that should be checked, since 8.3.7 certain files seems not to be picked into check.

Having unused use statement in eg. .install file with 8.3.6 you will get error, but any never version after that it will not get picked. But the actual problem is that the file itself is being ignored.

This can be "fixed" by adding extensions, eg
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md .

But since this has changed lately, should it be fixed?

klausi’s picture

Status: Active » Fixed

Ah, good to know that explains it. The hard-coded list of file extensions was removed in #3074176: Allow extensions to be overridden in contrib phpcs.xml file to allow users to specify their own file extensions they want to run Coder/PHPCS on. Please always specify --extensions when running phpcs or set the extensions argument in your phpcs.xml.dist config file.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.