branch: elpa/flycheck
commit 2fd792204e44681d78ec80e38e53ae585a0314ef
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Fix php-phpcs-changed passing --git-base as single argument
"--git-base trunk" was passed as one argument instead of two.
Split into separate "--git-base" and branch name arguments.
Also make the base branch configurable via
flycheck-phpcs-changed-git-base (defaults to "trunk") and fix
the docstring formatting.
---
flycheck.el | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/flycheck.el b/flycheck.el
index 457fb18119..66db404b4a 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -10262,17 +10262,26 @@ See URL
`https://pear.php.net/package/PHP_CodeSniffer/'."
;; buffer is empty, see https://github.com/flycheck/flycheck/issues/907
:predicate flycheck-buffer-nonempty-p)
+(flycheck-def-option-var flycheck-phpcs-changed-git-base "trunk"
+ php-phpcs-changed
+ "The git base branch for PHPCS-Changed.
+
+The value of this variable is a string specifying the git branch
+to compare against (e.g. \"main\", \"master\", \"trunk\")."
+ :type '(string :tag "Branch name")
+ :safe #'stringp)
+
(flycheck-define-checker php-phpcs-changed
"A PHP style checker using PHPCS-Changed.
- Needs PHP Code Sniffer 2.6 or newer.
- See `https://github.com/sirbrillig/phpcs-changed'."
+
+Needs PHP Code Sniffer 2.6 or newer.
+See URL `https://github.com/sirbrillig/phpcs-changed'."
:command ("phpcs-changed"
"--git"
- "--git-base trunk"
+ "--git-base" (eval flycheck-phpcs-changed-git-base)
"--git-unstaged"
(option "--standard=" flycheck-phpcs-standard concat)
- (eval (buffer-file-name))
- )
+ (eval (buffer-file-name)))
:standard-input t
:error-parser flycheck-parse-checkstyle
:error-filter