[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 4ef339db0a 045/308: Don't locate standard for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 4ef339db0a 045/308: Don't locate standard for each buffer. |
Date: |
Tue, 25 Jan 2022 10:59:17 -0500 (EST) |
branch: elpa/drupal-mode
commit 4ef339db0ae8f93fa6a618c9fa2139627173803b
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Don't locate standard for each buffer.
No need to locate whether Drupal coding standards for PHP CodeSniffer
is installed each time we visit a new buffer.
Instead we locate the Drupal coding standard in a defcustom only once
(and as bonus the user can supply her own standard if wanted).
---
drupal/flymake-phpcs.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index a8ac52af74..00e909449b 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -6,19 +6,28 @@
;;; Code:
+(defcustom drupal/flymake-phpcs-standard
+ (ignore-errors
+ (let ((standards (with-output-to-string
+ (with-current-buffer standard-output
+ (call-process (executable-find flymake-phpcs-command)
nil (list t nil) nil "-i")))))
+ (string-match
+ "\\(Drupal[^,
+]*\\)"
+ standards)
+ (match-string-no-properties 1 standards)))
+ "Name of Drupal coding standard rules for PHP CodeSniffer."
+ :link '(url-link :tag "Drupal Code Sniffer"
"http://drupal.org/project/drupalcs")
+ :group 'drupal)
+
(defun drupal/flymake-phpcs-enable ()
"Enable drupal-mode support for flymake-phpcs."
(when (and (eq major-mode 'php-mode)
(executable-find flymake-phpcs-command)
- (ignore-errors
- (string-match
- "Drupal"
- (with-output-to-string
- (with-current-buffer standard-output
- (call-process (executable-find flymake-phpcs-command) nil
(list t nil) nil "-i"))))))
+ drupal/flymake-phpcs-standard)
;; Set the coding standard to "Drupal" (we checked that it is
;; supported above.
- (set (make-local-variable 'flymake-phpcs-standard) "Drupal")
+ (set (make-local-variable 'flymake-phpcs-standard)
drupal/flymake-phpcs-standard)
;; This is a php-mode file so add the extension to a buffer locale
;; version of `flymake-allowed-file-name-masks' and make
- [nongnu] elpa/drupal-mode 46205ad74c 244/308: Merge branch 'release/0.6.0', (continued)
- [nongnu] elpa/drupal-mode 46205ad74c 244/308: Merge branch 'release/0.6.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cf0364cbaf 248/308: Merge branch 'release/0.6.1', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d9745316b3 261/308: Merge pull request #62 from arnested/feature/helm-gtags-compatibility, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0a23dc084a 266/308: Add autoinsert template for .api.php files, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 947b893b37 274/308: Handle case where `c-default-style` is a string, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f93cdfe1b2 278/308: Use proper indent for continuation lines, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9d793aa112 286/308: Add support for gxref/xref, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dc82e5430c 295/308: Handle .info.yml files, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a1c77dca8b 300/308: Prefer HTTPS URLs wherever we can, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 83ee02f80a 024/308: Renamed `drupal-root' to `drupal-rootdir'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4ef339db0a 045/308: Don't locate standard for each buffer.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 808d1f1768 080/308: Use `eldoc-mode' for function argument tips., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ca7773df72 102/308: Added `drupal-mode-beginning-of-line' for .info files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f17e7088ca 107/308: Provide Drupal projects as webjump sites., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 043644e85d 109/308: Set correct comment style for inline comments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dfd4582048 115/308: Fixed argument insert in `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dcea92f3a9 117/308: Added autoinsert skeleton for .test files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6dd8edc402 121/308: Eliminated compiler warnings., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 16632d6cf7 133/308: Fixed drush version detection for Drush 7., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 58fb25a914 138/308: Added .cask to .gitignore., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d04b119de7 141/308: Properly add our checkers to flycheck-checkers instead of enforcing it., ELPA Syncer, 2022/01/25