yapfify
yapfify copied to clipboard
Yapf for Emacs
[[https://circleci.com/gh/JorisE/yapfify][https://circleci.com/gh/JorisE/yapfify.svg?style=svg]]
-
Yapfify Yapfify uses yapf to format a Python buffer. It can be called explicitly on a certain buffer, but more conveniently, a minor-mode 'yapf-mode' is provided that turns on automatically running YAPF on a buffer before saving.
-
Installation:
Add yapfify.el to your load-path.
To automatically format all Python buffers before saving, add the function yapf-mode to python-mode-hook:
#+BEGIN_SRC emacs-lisp (add-hook 'python-mode-hook 'yapf-mode) #+END_SRC
- Why not py-yapf?
Py-yapf works on a temporary file (placed in /tmp). Therefore it does not pick up on any project specific YAPF styles. Yapfify works on the original file, so that any project settings supported by YAPF itself are used.