chore(formatting): expand reformatter macro on first use rather than init

This commit is contained in:
2021-05-22 14:34:18 +01:00
parent 9709688154
commit b772a6a61d
2 changed files with 18 additions and 13 deletions

View File

@@ -48,14 +48,17 @@
(siren-folding)
(subword-mode +1))
(defun siren-define-golines-format-mode ()
;; Setup golines formatter for manual use - on save formatting is handled by
;; lsp-mode.
(reformatter-define golines-format
:program "golines"
:args '("-t" "4" "-m" "80" "--no-reformat-tags"
"--base-formatter=gofumports")
:lighter "GOLINES"))
:config
;; Setup golines formatter for manual use - on save formatting is handled by
;; lsp-mode.
(reformatter-define golines
:program "golines"
:args '("-t" "4" "-m" "80" "--no-reformat-tags"
"--base-formatter=gofumports")
:lighter "GOLINES")
(siren-define-golines-format-mode)
(define-key 'help-command (kbd "G") 'godoc)

View File

@@ -22,14 +22,16 @@
(setq-local tab-width 2)
(terraform-format-on-save-mode 1))
(defun siren-define-terraform-format-mode ()
;; This does a better job of injecting formatted content than the default
;; formatting commands included with terraform-mode.
(reformatter-define terraform-format
:program "terraform"
:args '("fmt" "-no-color" "-")
:lighter " TF"))
:config
;; This does a better job of injecting formatted content than the default
;; formatting commands included with terraform-mode.
(reformatter-define terraform-format
:program "terraform"
:args '("fmt" "-no-color" "-")
:lighter " TF")
(siren-define-terraform-format-mode)
;; When terraform-ls CLI tool is available, setup lsp-mode to use it
(when (executable-find "terraform-ls")