Doom-emacs: [QUESTION] format-project

Created on 21 Nov 2019  路  2Comments  路  Source: hlissner/doom-emacs

Hello, doom-emacs hacker,
Can I use doom-emacs to format all source code files under the entire project at once without opening all the project files ?

:editor format question resolved

All 2 comments

Not easily. Your best bet is to run your formatter on the command line on all your source files.

If you're dead set on doing it in Emacs, you can try something like this:

(dolist (file (doom-files-in "path/to/project" :match "\\.py$"))
  (with-current-buffer (find-file-noselect file)
    (call-interactively #'format-all-buffer)
    (save-buffer)))

But it'd be incredibly slow, depending on project size.

So nice !
Thanks very much.
I will try it !

Was this page helpful?
0 / 5 - 0 ratings