Skip to content

Commit f25b01e

Browse files
committed
chore: minor improvements
1 parent 4f7553e commit f25b01e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

lisp/core/analyze.el

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737

3838
(defun eask-analyze--load-buffer ()
3939
"Return the current file loading session."
40-
(car (cl-remove-if-not
41-
(lambda (elm) (string-prefix-p " *load*-" (buffer-name elm))) (buffer-list))))
40+
(car (cl-remove-if-not (lambda (elm)
41+
(string-prefix-p " *load*-" (buffer-name elm)))
42+
(buffer-list))))
4243

4344
(defun eask-analyze--write-json-format (level msg)
4445
"Prepare log for JSON format.
@@ -98,7 +99,9 @@ Argument LEVEL and MSG are data from the debug log signal."
9899
level msg))))
99100

100101
(defun eask-stdout (msg &rest args)
101-
"Like `eask-msg' but prints to stdout."
102+
"Like `eask-msg' but prints to stdout.
103+
104+
For arguments MSG and ARGS, please see function `eask-msg' for the "
102105
(eask-princ (apply #'eask--format-paint-kwds msg args) nil)
103106
(eask-princ "\n" nil))
104107

@@ -108,30 +111,30 @@ Argument LEVEL and MSG are data from the debug log signal."
108111
;; Linting
109112
(dolist (file files)
110113
(eask--silent-error
111-
(eask--save-load-eask-file file
112-
(push file checked-files)
113-
(push file checked-files))))
114+
(eask--save-load-eask-file file
115+
(push file checked-files))))
114116

115117
;; Print result
116118
(eask-msg "")
117-
(cond ((eask-json-p) ; JSON format
119+
(cond ((eask-json-p) ; JSON format
120+
;; Fill content with result.
118121
(when (or eask-analyze--warnings eask-analyze--errors)
119122
(setq content
120123
(eask-analyze--pretty-json (json-encode
121124
`((warnings . ,eask-analyze--warnings)
122125
(errors . ,eask-analyze--errors))))))
123126
;; XXX: When printing the result, no color allow.
124127
(eask--with-no-color
125-
(eask-stdout (or content "{}"))))
126-
(eask-analyze--log ; Plain text
128+
(eask-stdout (or content "{}"))))
129+
(eask-analyze--log ; Plain text
127130
(setq content
128131
(with-temp-buffer
129132
(dolist (msg (reverse eask-analyze--log))
130133
(insert msg "\n"))
131134
(buffer-string)))
132135
;; XXX: When printing the result, no color allow.
133136
(eask--with-no-color
134-
(mapc #'eask-stdout (reverse eask-analyze--log)))))
137+
(mapc #'eask-stdout (reverse eask-analyze--log)))))
135138

136139
(eask-info "(Checked %s file%s)"
137140
(length checked-files)
@@ -160,7 +163,7 @@ Argument LEVEL and MSG are data from the debug log signal."
160163
(files
161164
(eask-analyze--file files)
162165
(when eask-analyze--error-p
163-
(eask--exit 1)))
166+
(eask--exit 'failure)))
164167
;; Pattern defined, but no file found!
165168
(patterns
166169
(eask-info "(No files match wildcard: %s)"

0 commit comments

Comments
 (0)