Skip to content

JorisE/yapfify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c9347e3 · Sep 14, 2021

History

29 Commits
Sep 16, 2016
Sep 16, 2016
Sep 16, 2016
Sep 16, 2016
Sep 16, 2016
Sep 16, 2016
Sep 14, 2021

Repository files navigation

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:

(add-hook 'python-mode-hook 'yapf-mode)

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.