branch: elpa/drupal-mode
commit 430b04536e1980e9cbd7bbaac6ef45cf79526c06
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>

    Added special case for .tpl.php extensions.
---
 drupal/flymake-phpcs.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index a75d76289a..d861bf3f22 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -49,8 +49,11 @@
     ;; version of `flymake-allowed-file-name-masks' and make
     ;; flymake-phpcs initialize.
     (make-local-variable 'flymake-allowed-file-name-masks)
-    (add-to-list 'flymake-allowed-file-name-masks
-                 `(,(concat "\\." (file-name-extension (or buffer-file-name 
(buffer-name))) "\\'") flymake-phpcs-init))
+    (let ((extension (file-name-extension (or buffer-file-name 
(buffer-name)))))
+      (when (string-match "\\.tpl\\.php\\'" (or buffer-file-name 
(buffer-name)))
+        (setq extension "tpl\\.php"))
+      (add-to-list 'flymake-allowed-file-name-masks
+                   `(,(concat "\\." extension "\\'") flymake-phpcs-init)))
     (flymake-mode 1)))
 
 (add-hook 'drupal-mode-hook #'drupal/flymake-phpcs-enable)

Reply via email to