

YAPF – A formatter for Python files - pdknsk
https://github.com/google/yapf

======
pmags
Look's interesting, but I hesitate to use a Python formatting tool whose own
code runs counter to well accepted Python stylistic guidelines -- namely "Use
4 spaces per indentation level."
([https://www.python.org/dev/peps/pep-0008/#indentation](https://www.python.org/dev/peps/pep-0008/#indentation))

~~~
geoelectric
Without some examples from the author (or sinking time into installing/playing
with it) it's pretty hard for me to tell what it's actually going to do with
the code.

AutoPEP8 will generally intelligently pick between a standard hanging indent,
a deep hanging indent, and an aligned indent. Does this not do so?

Edit: oh, I see. The author's code uses two spaces. Heh.

~~~
ketralnis
That is apparently the "google style"
[https://github.com/google/yapf/blob/master/yapf/yapflib/styl...](https://github.com/google/yapf/blob/master/yapf/yapflib/style.py#L114)

No option to change the line endings though, and it changes them all to
Windows style.

~~~
geoelectric
I thought about that, but [https://google-
styleguide.googlecode.com/svn/trunk/pyguide.h...](https://google-
styleguide.googlecode.com/svn/trunk/pyguide.html) makes it pretty clear Google
Style is 4 spaces.

It's under Python Style Rules | Indentation.

------
strunz
Interesting, but on a quick test it looks like it changes UNIX-style line
endings (LF) to Windows (CRLF).

~~~
eliben
This shouldn't happen - please report an issue

