(setq +format-on-save-enabled-modes
'(not emacs-lisp-mode ; elisp's mechanisms are good enough
sql-mode ; sqlformat is currently broken
tex-mode ; latexindent is broken
latex-mode))
If you want to format code when you save a buffer, but want more granular
control over which major modes this behavior is enabled in, there is an
alternative. Make sure +onsave is disabled before you try this:
(add-hook 'python-mode-hook #'format-all-mode)
(add-hook 'js2-mode-hook #'format-all-mode)
(setq-hook! 'python-mode-hook +format-with 'html-tidy)
;; Or set it to `:none' to disable formatting
(setq-hook! 'python-mode-hook +format-with :none)
Formatters are referred to by the name they were defined with. They can be
looked up in the format-all-mode-table
hash table or in format-all’s source
code.