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

Related issues

Ptival picture Ptival  Â·  3Comments

oyarsa picture oyarsa  Â·  3Comments

rgrinberg picture rgrinberg  Â·  3Comments

luisenrike picture luisenrike  Â·  3Comments

idoo picture idoo  Â·  3Comments