arnested / drupal-mode

Advanced Emacs minor mode for Drupal development
https://melpa.org/#/drupal-mode
GNU General Public License v3.0
32 stars 14 forks source link

drupal-phpcs generates error with flycheck 'release-0.22' #56

Closed dhaley closed 9 years ago

dhaley commented 9 years ago

I upgraded to flycheck 'release-0.22', which broke the 'drupal-phpcs' checker.

(flycheck-select-checker 'drupal-phpcs)

generates this error:

Can't use syntax checker drupal-phpcs in this buffer

xendk commented 9 years ago

You're not supposed to select the checker specifically, flycheck will automatically use the first compatible checker, and the drupal-phpcs makes an effort of adding itself as next-checker to all checker that'll run in any major-mode that drupal-mode supports.

The notable exception being, funnily enough, php-mode itself, as we just set the phpcs standard to the Drupal Coding Standard and use the regular phpcs cheker.

The drupal-phpcs checker is an oddity, as it's running phpcs on non-php files, as the regular phpcs checker only runs in php modes.

What kind of file are you trying to check?

dhaley commented 9 years ago

I'm just trying to check a Drupal .module file.

Phpcs works at the command line:

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme sws.module

...And flycheck-verify-setup looks fine.

Syntax checkers for buffer sws_fg.module in php-mode:

php

Flycheck Mode is enabled.

But flycheck-next-error, generates "No more Flycheck errors," which I know isn't true. Any idea, how I could troubleshoot further?

xendk commented 9 years ago

Is drupal-mode active?

What's the value of the flycheck-phpcs-standard variable?

dhaley commented 9 years ago

It looks like this is not an issue with drupal-mode as I can't get the php-phpcs checker to apply to non-Drupal php buffers.

I have opened an issue with flycheck (https://github.com/flycheck/flycheck/issues/561) as I can't get the php-phpcs checker to apply on a php buffer even using Emacs -Q to rule out my configuration settings.

Let me know if you have any other suggestions though.

dhaley commented 9 years ago

This is not an issue with drupal-mode, but I did learn a lot about drupal phpcs checker :+1: Closing.