ci: fix more errors

This commit is contained in:
Pavel Korytov 2023-07-22 23:27:57 +03:00
parent b7d8fbbe94
commit 379a3d1df6
3 changed files with 53 additions and 53 deletions

View file

@ -104,8 +104,9 @@ QUERY is a form as defined by `biome-query-current'."
(insert (propertize "Reason: " 'face 'font-lock-warning-face)
(alist-get 'reason (request-response-data response))
"\n")
(insert "Can't parse reason. Raw response: \n"
(prin1-to-string response)))
(error
(insert "Can't parse reason. Raw response: \n"
(prin1-to-string response))))
(biome-api-error-mode))
(switch-to-buffer buffer)))

View file

@ -42,51 +42,51 @@
FORMAT is an expression as defined by `biome-grid-format'."
(nreverse
(reduce (lambda (acc def)
(push def acc)
(let ((unit (nth 0 def))
(format-def (nth 2 def)))
(when (and unit (eq (car-safe format-def) 'gradient))
(pcase unit
("°C" (push `("°F" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (+ (* 1.8 (car c)) 32) (cdr c)))
(cdr format-def))))
acc))
("m/s"
(push `("km/h" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 3.6 (car c)) (cdr c)))
(cdr format-def))))
acc)
(push `("mph" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 2.237 (car c)) (cdr c)))
(cdr format-def))))
acc)
(push `("knots" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 1.944 (car c)) (cdr c)))
(cdr format-def))))
acc))
("mm" (push `("inch" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (/ (car c) 25.4) (cdr c)))
(cdr format-def))))
acc))
("cm" (push `("inch" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (/ (car c) 2.54) (cdr c)))
(cdr format-def))))
acc)))))
acc)
format :initial-value nil)))
(cl-reduce (lambda (acc def)
(push def acc)
(let ((unit (nth 0 def))
(format-def (nth 2 def)))
(when (and unit (eq (car-safe format-def) 'gradient))
(pcase unit
("°C" (push `("°F" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (+ (* 1.8 (car c)) 32) (cdr c)))
(cdr format-def))))
acc))
("m/s"
(push `("km/h" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 3.6 (car c)) (cdr c)))
(cdr format-def))))
acc)
(push `("mph" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 2.237 (car c)) (cdr c)))
(cdr format-def))))
acc)
(push `("knots" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (* 1.944 (car c)) (cdr c)))
(cdr format-def))))
acc))
("mm" (push `("inch" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (/ (car c) 25.4) (cdr c)))
(cdr format-def))))
acc))
("cm" (push `("inch" ,(nth 1 def)
(gradient
. ,(mapcar (lambda (c)
(cons (/ (car c) 2.54) (cdr c)))
(cdr format-def))))
acc)))))
acc)
format :initial-value nil)))
(defcustom biome-grid-format
(biome-grid--format-units
@ -590,7 +590,7 @@ transient switches)."
for key = (gethash name keys)
collect
(transient-parse-suffix
transient-prefix
'transient-prefix
`(,key ,name ,(format "--%s" api-key)
:init-value
(lambda (obj)

View file

@ -220,7 +220,7 @@ KEY is the api key of the variable. VAR-NAMES is the output of
" "
(if lon (propertize (number-to-string lon) 'face 'transient-value)
(propertize "unset" 'face 'error))
(when-let ((_ (and lat lon))
(when-let ((_nothing (and lat lon))
(loc (seq-find
(lambda (x) (equal (cdr x) (list lat lon)))
biome-query-coords)))
@ -678,7 +678,7 @@ at 3."
(seq-lengths (mapcar #'length sequences)))
(dolist (item-take (thread-last
(reverse sequences)
(reduce #'biome-query--cartesian-product)
(cl-reduce #'biome-query--cartesian-product)
(mapcar (lambda (it) (if (listp it) (nreverse it) (list it))))
;; XXX this seems to be just a bit faster than `seq-sort-by'.
(mapcar (lambda (it)
@ -736,10 +736,9 @@ exclude from the result."
(cl-loop
for name in names-to-update
for old-key = (gethash name keys-by-name)
for key = (iter-next (gethash name iters))
if old-key do (puthash old-key (remove name (gethash old-key names-by-key)) names-by-key)
do (puthash key (cons name (gethash key names-by-key)) names-by-key)
do (puthash name key keys-by-name)))
do (puthash name (iter-next (gethash name iters)) keys-by-name)))
keys-by-name))
(defun biome--query-section-fields-define-infixes (fields keys param infix-name)
@ -990,7 +989,7 @@ SECTION is a form as defined in `biome-api-parse--page'."
(setq biome-query-current nil))
(unless biome-query-current
(biome-query--reset-report))
(biome-query--section params)))
(funcall-interactively #'biome-query--section params)))
(transient-define-prefix biome-query (callback)
["Open Meteo Data"