Skip to content

Commit fbbed37

Browse files
author
Chen Bin
committed
upgrade lazyflymake
1 parent 0475913 commit fbbed37

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

site-lisp/lazyflymake/lazyflymake-eslint.el

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
(require 'lazyflymake-sdk)
99

10+
(defcustom lazyflymake-eslint-args '("--format" "unix")
11+
"Arguments of eslint cli."
12+
:group 'lazyflymake
13+
:type '(repeat string))
14+
1015
(defun lazyflymake-eslint-err-line-pattern ()
1116
"Return error line pattern.
1217
If return a list containing patterns, `flymake-proc-err-line-patterns' uses the
@@ -20,7 +25,6 @@ If return nil, nothing need be done."
2025
(let* ((dir (locate-dominating-file default-directory "node_modules"))
2126
(local-eslint (concat dir "node_modules/.bin/eslint"))
2227
(program (if (file-exists-p local-eslint) local-eslint "eslint"))
23-
(eslint-args '("--format" "unix"))
2428
file
2529
;; use babel?
2630
(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."
3034

3135
;; use locale babel configuration file
3236
(when babelrc
33-
(push (format "{babelOptions:{configFile:'%s'}}" (file-truename babelrc)) eslint-args)
34-
(push "--parser-options" eslint-args))
37+
(push (format "{babelOptions:{configFile:'%s'}}" (file-truename babelrc))
38+
lazyflymake-eslint-args)
39+
(push "--parser-options" lazyflymake-eslint-args))
3540

3641
(lazyflymake-sdk-generate-flymake-init
3742
program
38-
eslint-args
43+
lazyflymake-eslint-args
3944
file))))
4045

4146
(provide 'lazyflymake-eslint)

site-lisp/lazyflymake/lazyflymake-shell.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
:group 'lazyflymake
1313
:type 'string)
1414

15+
(defcustom lazyflymake-shell-args '("--format=gcc" "-x")
16+
"Arguments of shellcheck cli."
17+
:group 'lazyflymake
18+
:type '(repeat string))
19+
1520
(defun lazyflymake-shell-err-line-pattern ()
1621
"Return error line pattern.
17-
If return a list containing the pattern, `flymake-proc-err-line-patterns' uses the
22+
If return a list of patterns, `flymake-proc-err-line-patterns' uses the
1823
list and is also converted into a buffer local variable.
1924
If return the pattern, it's is pushed to `flymake-proc-err-line-patterns'.
2025
If return nil, nothing need be done."
@@ -29,7 +34,7 @@ If return nil, nothing need be done."
2934
(if lazyflymake-debug (message "lazyflymake-shell-init called"))
3035
(lazyflymake-sdk-generate-flymake-init
3136
lazyflymake-shell-program
32-
'("--format=gcc")
37+
lazyflymake-shell-args
3338
file))))
3439

3540
(provide 'lazyflymake-shell)

0 commit comments

Comments
 (0)