apply elfmt's reformatting

This commit is contained in:
riscy 2021-02-20 18:02:25 -08:00
parent cf6e1dbc19
commit 8f11afa5d7

View file

@ -105,7 +105,8 @@
(let ((package-lint-main-file (melpazoid--package-lint-main-file))) (let ((package-lint-main-file (melpazoid--package-lint-main-file)))
(ignore-errors (package-lint-current-buffer))) (ignore-errors (package-lint-current-buffer)))
(with-current-buffer (get-buffer-create "*Package-Lint*") (with-current-buffer (get-buffer-create "*Package-Lint*")
(let ((output (melpazoid--newline-trim (buffer-substring (point-min) (point-max))))) (let ((output
(melpazoid--newline-trim (buffer-substring (point-min) (point-max)))))
(if (string= "No issues found." output) (if (string= "No issues found." output)
(melpazoid-insert "- No issues!") (melpazoid-insert "- No issues!")
(melpazoid-insert "```") (melpazoid-insert "```")
@ -135,8 +136,11 @@
(defun melpazoid--package-lint-main-file () (defun melpazoid--package-lint-main-file ()
"Return suitable value for `package-lint-main-file'." "Return suitable value for `package-lint-main-file'."
(let ((package-main (getenv "PACKAGE_MAIN"))) (let ((package-main (getenv "PACKAGE_MAIN")))
(cond ((eq package-main nil) nil) (cond
((string= package-main "") nil) ((eq package-main nil)
nil)
((string= package-main "")
nil)
(t package-main)))) (t package-main))))
(defun melpazoid-check-declare () (defun melpazoid-check-declare ()
@ -156,8 +160,10 @@ a Docker container, e.g. kellyk/emacs does not include the .el files."
(defun melpazoid-check-sharp-quotes () (defun melpazoid-check-sharp-quotes ()
"Check for missing sharp quotes." "Check for missing sharp quotes."
(melpazoid-misc "#'(lambda " "There is no need to quote lambdas (neither #' nor ')") (melpazoid-misc
(melpazoid-misc "[^#]'(lambda " "Quoting this lambda may prevent it from being compiled") "#'(lambda " "There is no need to quote lambdas (neither #' nor ')")
(melpazoid-misc
"[^#]'(lambda " "Quoting this lambda may prevent it from being compiled")
(let ((msg "It's safer to sharp-quote function names; use `#'`")) (let ((msg "It's safer to sharp-quote function names; use `#'`"))
(melpazoid-misc "(apply-on-rectangle '[^,]" msg) (melpazoid-misc "(apply-on-rectangle '[^,]" msg)
(melpazoid-misc "(apply-partially '[^,]" msg) (melpazoid-misc "(apply-partially '[^,]" msg)
@ -186,7 +192,8 @@ a Docker container, e.g. kellyk/emacs does not include the .el files."
(melpazoid-misc "(remove-hook '[^[:space:]]+ '" msg) (melpazoid-misc "(remove-hook '[^[:space:]]+ '" msg)
(melpazoid-misc "(advice-add '[^#)]*)" msg) (melpazoid-misc "(advice-add '[^#)]*)" msg)
(melpazoid-misc "(defalias '[^#()]*)" msg) (melpazoid-misc "(defalias '[^#()]*)" msg)
(melpazoid-misc "(define-obsolete-function-alias '[[:graph:]]+ '[[:graph:]]" msg) (melpazoid-misc
"(define-obsolete-function-alias '[[:graph:]]+ '[[:graph:]]" msg)
(melpazoid-misc "(run-with-idle-timer[^(#]*[^#]'" msg))) (melpazoid-misc "(run-with-idle-timer[^(#]*[^#]'" msg)))
(defun melpazoid-check-misc () (defun melpazoid-check-misc ()
@ -289,8 +296,7 @@ OBJECTS are objects to interpolate into the string using `format'."
(str (apply #'format str objects))) (str (apply #'format str objects)))
(if noninteractive (if noninteractive
(send-string-to-terminal str) (send-string-to-terminal str)
(with-current-buffer (get-buffer-create melpazoid-buffer) (with-current-buffer (get-buffer-create melpazoid-buffer) (insert str)))))
(insert str)))))
(defun melpazoid--newline-trim (str) (defun melpazoid--newline-trim (str)
"Sanitize STR by removing newlines." "Sanitize STR by removing newlines."
@ -339,18 +345,19 @@ OBJECTS are objects to interpolate into the string using `format'."
(setq melpazoid-can-modify-buffers t) (setq melpazoid-can-modify-buffers t)
(add-to-list 'load-path ".") (add-to-list 'load-path ".")
(let ((filename nil) (filenames (directory-files "."))) (let ((filename nil)
(filenames (directory-files ".")))
(while filenames (while filenames
(setq filename (car filenames) filenames (cdr filenames)) (setq filename (car filenames) filenames (cdr filenames))
(when (melpazoid--check-file-p filename) (when (melpazoid--check-file-p filename) (melpazoid filename))))
(melpazoid filename))))
;; check whether FILENAMEs can be simply loaded (TODO: offer backtrace) ;; check whether FILENAMEs can be simply loaded (TODO: offer backtrace)
(melpazoid-insert "\n### Loadability ###\n") (melpazoid-insert "\n### Loadability ###\n")
(melpazoid-insert "Verifying ability to #'load each file:") (melpazoid-insert "Verifying ability to #'load each file:")
(melpazoid-insert "```") (melpazoid-insert "```")
(let ((filename nil) (filenames (directory-files "."))) (let ((filename nil)
(filenames (directory-files ".")))
(while filenames (while filenames
(setq filename (car filenames) filenames (cdr filenames)) (setq filename (car filenames) filenames (cdr filenames))
(when (melpazoid--check-file-p filename) (when (melpazoid--check-file-p filename)