From fbbed375e9bde9e6f0daf3e204d025abeef2dfba Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Mon, 2 Dec 2024 19:03:53 +1100 Subject: [PATCH] upgrade lazyflymake --- site-lisp/lazyflymake/lazyflymake-eslint.el | 13 +++++++++---- site-lisp/lazyflymake/lazyflymake-shell.el | 9 +++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/site-lisp/lazyflymake/lazyflymake-eslint.el b/site-lisp/lazyflymake/lazyflymake-eslint.el index 60ff68a6ab..3c6f86ec8d 100644 --- a/site-lisp/lazyflymake/lazyflymake-eslint.el +++ b/site-lisp/lazyflymake/lazyflymake-eslint.el @@ -7,6 +7,11 @@ (require 'lazyflymake-sdk) +(defcustom lazyflymake-eslint-args '("--format" "unix") + "Arguments of eslint cli." + :group 'lazyflymake + :type '(repeat string)) + (defun lazyflymake-eslint-err-line-pattern () "Return error line pattern. If return a list containing patterns, `flymake-proc-err-line-patterns' uses the @@ -20,7 +25,6 @@ If return nil, nothing need be done." (let* ((dir (locate-dominating-file default-directory "node_modules")) (local-eslint (concat dir "node_modules/.bin/eslint")) (program (if (file-exists-p local-eslint) local-eslint "eslint")) - (eslint-args '("--format" "unix")) file ;; use babel? (babelrc (lazyflymake-sdk-find-dominating-file '("babel.config.json" ".babelrc.json" "babel.config.js")))) @@ -30,12 +34,13 @@ If return nil, nothing need be done." ;; use locale babel configuration file (when babelrc - (push (format "{babelOptions:{configFile:'%s'}}" (file-truename babelrc)) eslint-args) - (push "--parser-options" eslint-args)) + (push (format "{babelOptions:{configFile:'%s'}}" (file-truename babelrc)) + lazyflymake-eslint-args) + (push "--parser-options" lazyflymake-eslint-args)) (lazyflymake-sdk-generate-flymake-init program - eslint-args + lazyflymake-eslint-args file)))) (provide 'lazyflymake-eslint) diff --git a/site-lisp/lazyflymake/lazyflymake-shell.el b/site-lisp/lazyflymake/lazyflymake-shell.el index f43ff95f24..8f3cc5df05 100644 --- a/site-lisp/lazyflymake/lazyflymake-shell.el +++ b/site-lisp/lazyflymake/lazyflymake-shell.el @@ -12,9 +12,14 @@ :group 'lazyflymake :type 'string) +(defcustom lazyflymake-shell-args '("--format=gcc" "-x") + "Arguments of shellcheck cli." + :group 'lazyflymake + :type '(repeat string)) + (defun lazyflymake-shell-err-line-pattern () "Return error line pattern. -If return a list containing the pattern, `flymake-proc-err-line-patterns' uses the +If return a list of patterns, `flymake-proc-err-line-patterns' uses the list and is also converted into a buffer local variable. If return the pattern, it's is pushed to `flymake-proc-err-line-patterns'. If return nil, nothing need be done." @@ -29,7 +34,7 @@ If return nil, nothing need be done." (if lazyflymake-debug (message "lazyflymake-shell-init called")) (lazyflymake-sdk-generate-flymake-init lazyflymake-shell-program - '("--format=gcc") + lazyflymake-shell-args file)))) (provide 'lazyflymake-shell)