fix(format): register shfmt for sh-mode

Apheleia already has a (and better) definition for shfmt.

Fix: #5268
This commit is contained in:
Henrik Lissner 2024-07-30 02:45:44 -04:00
parent 85b7b6151b
commit 0bac5fe132
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 2 additions and 4 deletions

View file

@ -44,6 +44,8 @@ This is controlled by `+format-on-save-disabled-modes'."
(add-to-list 'doom-debug-variables '(apheleia-log-only-errors . nil)) (add-to-list 'doom-debug-variables '(apheleia-log-only-errors . nil))
(add-to-list 'doom-debug-variables '(apheleia-log-debug-info . t)) (add-to-list 'doom-debug-variables '(apheleia-log-debug-info . t))
(add-to-list 'apheleia-mode-alist '(sh-mode . shfmt))
;; A psuedo-formatter that dispatches to the appropriate LSP client (via ;; A psuedo-formatter that dispatches to the appropriate LSP client (via
;; `lsp-mode' or `eglot') that is capable of formatting. Without +lsp, users ;; `lsp-mode' or `eglot') that is capable of formatting. Without +lsp, users
;; must manually set `+format-with' to `lsp' to use it, or activate ;; must manually set `+format-with' to `lsp' to use it, or activate

View file

@ -18,10 +18,6 @@
:config :config
(set-docsets! 'sh-mode "Bash") (set-docsets! 'sh-mode "Bash")
(set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;")) (set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
(set-formatter! 'shfmt '("shfmt" "-ci"
(unless indent-tabs-mode
(list "-i" (number-to-string tab-width)))))
(set-repl-handler! 'sh-mode #'+sh/open-repl) (set-repl-handler! 'sh-mode #'+sh/open-repl)
(set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler) (set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler)
(set-ligatures! 'sh-mode (set-ligatures! 'sh-mode