Skip to content

Commit 0a5c953

Browse files
committed
flymake-phpcs will only be used in php-mode.
1 parent 25dc733 commit 0a5c953

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drupal/flymake-phpcs.el

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
(defun drupal/flymake-phpcs-enable ()
1010
"Enable drupal-mode support for flymake-phpcs."
11-
(when (and (executable-find flymake-phpcs-command)
12-
(ignore-errors
13-
(string-match
14-
"Drupal"
15-
(with-output-to-string
16-
(with-current-buffer standard-output
17-
(call-process (executable-find flymake-phpcs-command) nil (list t nil) nil "-i"))))))
11+
(when (and (eq major-mode 'php-mode)
12+
(executable-find flymake-phpcs-command)
13+
(ignore-errors
14+
(string-match
15+
"Drupal"
16+
(with-output-to-string
17+
(with-current-buffer standard-output
18+
(call-process (executable-find flymake-phpcs-command) nil (list t nil) nil "-i"))))))
1819
(set (make-local-variable 'flymake-phpcs-standard) "Drupal")
1920
;; We have probably set `flymake-phpcs-standard' after a syntax
2021
;; check was initiated - so kill it and start syntax check again.

0 commit comments

Comments
 (0)