Skip to content

Commit 3c32d7e

Browse files
spaceotterarnested
authored andcommitted
flycheck-declare-checker is now flycheck-define-checker
Fixes #38.
1 parent 31c2b67 commit 3c32d7e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

drupal/flycheck.el

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal/flycheck.el --- Drupal-mode support for flycheck and phpcs
22

3-
;; Copyright (C) 2012, 2013 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2014 Arne Jørgensen
44

55
;; Author: Thomas Fini Hansen <[email protected]>
66

@@ -25,6 +25,9 @@
2525

2626
;;; Code:
2727

28+
(eval-when-compile
29+
(require 'flycheck))
30+
2831
(require 'drupal/phpcs)
2932

3033
(defcustom drupal/flycheck-phpcs-js-and-css t
@@ -48,27 +51,28 @@
4851

4952
(add-hook 'drupal-mode-hook #'drupal/flycheck-hook)
5053

51-
(flycheck-declare-checker css-js-phpcs
54+
(flycheck-define-checker css-js-phpcs
5255
"Check CSS and JavaScript using PHP_CodeSniffer.
5356
5457
PHP_CodeSniffer can be used to check non-PHP files, as exemplified by the
5558
Drupal code sniffer.
5659
5760
See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
58-
:command '("phpcs" "--report=emacs"
59-
(option "--standard=" flycheck-phpcs-standard)
60-
source)
61+
:command ("phpcs" "--report=emacs"
62+
(option "--standard=" flycheck-phpcs-standard)
63+
source)
6164
;; Though phpcs supports Checkstyle output which we could feed to
6265
;; `flycheck-parse-checkstyle', we are still using error patterns here,
6366
;; because PHP has notoriously unstable output habits. See URL
6467
;; `https://github.com/lunaryorn/flycheck/issues/78' and URL
6568
;; `https://github.com/lunaryorn/flycheck/issues/118'
6669
:error-patterns
67-
'(("\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): error - \\(?4:.*\\)" error)
68-
("\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): warning - \\(?4:.*\\)" warning))
69-
:modes '(css-mode js-mode)
70+
((error "\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): error - \\(?4:.*\\)")
71+
(warning "\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): warning - \\(?4:.*\\)"))
72+
:modes (css-mode js-mode)
7073
:predicate (lambda ()
7174
(and drupal/flycheck-phpcs-js-and-css (apply 'derived-mode-p (append drupal-php-modes drupal-css-modes drupal-js-modes)))))
75+
7276
(add-to-list 'flycheck-checkers 'css-js-phpcs)
7377

7478

0 commit comments

Comments
 (0)