Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions format-all.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
;; - Terraform (terraform fmt)
;; - TypeScript/TSX (prettier)
;; - YAML (yq)
;; - Nginx (crossplane)
;;
;; You will need to install external programs to do the formatting.
;; If `format-all-buffer` can't find the right program, it will try to
Expand Down Expand Up @@ -623,6 +624,15 @@ Consult the existing formatters for examples of BODY."
(:modes yaml-mode)
(:format (format-all--buffer-easy executable "read" "-")))

(define-format-all-formatter crossplane
(:executable "crossplane")
(:install (macos "pip install crossplane"))
(:modes nginx-mode)
(:format (format-all--buffer-easy executable "format"
(when (buffer-file-name)
(buffer-file-name))
)))

(defun format-all--please-install (executable installer)
"Internal helper function for error about missing EXECUTABLE and INSTALLER."
(concat (format "You need the %S command." executable)
Expand Down