[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 7402b9e9fb 201/308: Merge pull request #43 fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 7402b9e9fb 201/308: Merge pull request #43 from arnested/flycheck-update |
Date: |
Tue, 25 Jan 2022 10:59:47 -0500 (EST) |
branch: elpa/drupal-mode
commit 7402b9e9fb43ad5ac473d3080d8d7e8920091301
Merge: 7b2c43bd41 13b2fff6ef
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Merge pull request #43 from arnested/flycheck-update
Use flycheck-add-next-checker.
---
drupal/flycheck.el | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drupal/flycheck.el b/drupal/flycheck.el
index 84d5da1a46..5f2d948bc5 100644
--- a/drupal/flycheck.el
+++ b/drupal/flycheck.el
@@ -28,19 +28,11 @@
(require 'flycheck)
(require 'drupal/phpcs)
-(defcustom drupal/flycheck-phpcs-js-and-css t
- "When Non-nil, override Flycheck to use PHPCS for checking CSS and
JavaScript files instead of the checkers configured for css-mode and js-mode."
- :type `(choice
- (const :tag "Yes" t)
- (const :tag "No" nil))
- :group 'drupal)
-
(defun drupal/flycheck-hook ()
"Enable drupal-mode support for flycheck."
- (when (and (apply 'derived-mode-p (append drupal-php-modes drupal-css-modes
drupal-js-modes))
- drupal/phpcs-standard)
- ;; Set the coding standard to "Drupal" (we checked that it is
- ;; supported above.
+ (when (and drupal-mode drupal/phpcs-standard)
+ ;; Set the coding standard to "Drupal" (phpcs.el has checked that
+ ;; it's supported).
(setq flycheck-phpcs-standard drupal/phpcs-standard)
;; Flycheck will also highlight trailing whitespace as an
@@ -50,11 +42,11 @@
(add-hook 'drupal-mode-hook #'drupal/flycheck-hook)
-(flycheck-define-checker css-js-phpcs
- "Check CSS and JavaScript using PHP_CodeSniffer.
+(flycheck-define-checker drupal-phpcs
+ "Check non-PHP Drupal files using PHP_CodeSniffer.
-PHP_CodeSniffer can be used to check non-PHP files, as exemplified by the
-Drupal code sniffer.
+The Drupal standard includes checks for non-PHP files, this
+checker runs those.
See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
:command ("phpcs" "--report=emacs"
@@ -72,11 +64,19 @@ See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
(warning line-start
(file-name) ":" line ":" column ": warning - " (message)
line-end))
- :modes (css-mode js-mode)
+ ;; We'd prefer to just check drupal-mode, but flycheck global mode
+ ;; finds the checker before we get a chance to set drupal-mode.
:predicate (lambda ()
- (and drupal/flycheck-phpcs-js-and-css (apply 'derived-mode-p
(append drupal-php-modes drupal-css-modes drupal-js-modes)))))
-
-(add-to-list 'flycheck-checkers 'css-js-phpcs)
+ (apply 'derived-mode-p (append drupal-php-modes
drupal-css-modes drupal-js-modes drupal-info-modes))))
+
+;; Append our custom checker.
+(add-to-list 'flycheck-checkers 'drupal-phpcs t)
+;; Add our checker as next-checker to checkers of all supported modes.
+(let ((modes (append drupal-css-modes drupal-js-modes drupal-info-modes)))
+ (dolist (checker (flycheck-defined-checkers))
+ (dolist (mode (flycheck-checker-modes checker))
+ (if (memq mode modes)
+ (flycheck-add-next-checker checker 'drupal-phpcs)))))
(provide 'drupal/flycheck)
- [nongnu] elpa/drupal-mode 3ba088c812 139/308: No need for make-local-variable., (continued)
- [nongnu] elpa/drupal-mode 3ba088c812 139/308: No need for make-local-variable., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a6a4bfa842 144/308: No quoting necessary, says wiser minds than mine., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 996081be40 157/308: Merge branch 'release/0.3.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 97b60197d0 151/308: Improved rootdir detection for etags and gtags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8733eb2d1e 160/308: Bumped versio to 0.3.1., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 31c2b672aa 168/308: Added Api.drupalize.me as `drupal-search-url` option., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6bb266bc11 172/308: Fixed typo in latest commit., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2b71509ac3 171/308: Used `(buffer-name)` as fallback if `buffer-file-name` us not set., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 135c5f669e 197/308: Add interface with gtags via `ggtags.el', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b929895d51 184/308: Added own implementation of flymake init and temp names., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 7402b9e9fb 201/308: Merge pull request #43 from arnested/flycheck-update,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 60b231a125 202/308: Bumped version to 0.5.0., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c83705239e 214/308: Merge pull request #50 from kaaresl/develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5911ac2158 211/308: Fixed bad indentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 76199a3c68 243/308: Bump version number to 0.6.0., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6fbdf7946b 241/308: Fixed getting Drupal site temp folder., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d88b39e8f5 262/308: Fixed travis.yml, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3cae8bea76 267/308: Merge pull request #70 from arnested/api-skeleton, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 1545d07f0d 265/308: Use drupal/phpcs-standard in drupal-phpcs checker, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 690f2c5592 293/308: Cleanup URLs in documentation, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 81c63e7c5a 064/308: Removed accidental debug message., ELPA Syncer, 2022/01/25