Skip to content
Use yapf to beautify a Python buffer
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.bumpversion.cfg Bump version: 0.3 → 2016.1 Sep 25, 2016
.gitignore Use buftra functionality Apr 20, 2015
.travis.yml Update yapf install location Apr 22, 2015
CHANGELOG.org Bump version: 0.2 → 0.3 Jan 1, 2016
LICENSE
Makefile Update package meta data Sep 25, 2016
README.org Update yapf install location Apr 22, 2015
fetch-buftra.sh Use buftra functionality Apr 20, 2015
py-yapf.el Bump version: 0.3 → 2016.1 Sep 25, 2016
test-requirements.txt Update package meta data Sep 25, 2016
tests.el
tests.sh Refactor tests Apr 20, 2015

README.org

py-yapf.el

https://travis-ci.org/paetzke/py-yapf.el.svg?branch=master http://melpa.org/packages/py-yapf-badge.svg

Provides commands, which use the external yapf tool to tidy up the current buffer according to Python’s PEP8.

$ pip install yapf
$ wget https://raw.githubusercontent.com/paetzke/py-yapf.el/master/py-yapf.el \
       -O /your/path/py-yapf.el

You can also install py-yapf with MELPA:

M-x package-install RET
py-yapf RET

Add the save hook to your ~/.emacs

(add-to-list 'load-path "/your/path/")
(require 'py-yapf)
(add-hook 'python-mode-hook 'py-yapf-enable-on-save)

Now every time you save your Python file yapf will be executed on the current buffer.

Functions

  • M-x py-yapf-buffer RET: Uses the yapf tool to reformat the current buffer.

Bugs and improvements

Feel free to open tickets or send pull requests with improvements. These contributors have done so.

Copyright

Copyright (c) 2015 Friedrich Pätzke. See LICENSE for further details.

So long. Friedrich.

You can’t perform that action at this time.