lassik / emacs-format-all-the-code

Auto-format source code in many languages with one command
https://melpa.org/#/format-all
MIT License
623 stars 108 forks source link

Allow a formatter rule to override the executable name #246

Open knu opened 1 year ago

knu commented 1 year ago

This introduces a keyword symbol :executable to format-all-formatters.

It solves a typical problem where the predefined formatter is just fine but the executable you want to use instead is installed under the project working directory or elsewhere not necessarily in the default PATH.

e.g.

(setq format-all-formatters
      '(("JavaScript"
         (prettier
          :executable
          "node_modules/.bin/prettier"))))