[openstack-dev] [infra] What do people think of YAPF (like gofmt, for python)?

Monty Taylor mordred at inaugust.com
Wed Mar 25 23:22:25 UTC 2015

On 03/25/2015 05:50 PM, Maru Newby wrote:
> I am excited by the release of YAPF [1], a gofmt-like too for python.
> I think it has the potential to simplify style enforcement, and as
> much as I appreciate our current hacking checks, I’d be much happier
> not requiring developers to manually conform to them.  Maybe we can
> consider automation in a manner similar to that employed by the go
> codereview tool [2]?

I played with it for a few minutes and although it's configurable, it's
still pretty limited in terms of expressiveness.

That said - although I do appreciate the theory of auto-formatting
(seriously, one less thing, right?) I think it would be problematic for
us. You can't ship git hooks in a git repo, so we can't help our users
know to run it before pushing. In a world where getting set up in
openstack is already non-trivial, I think requiring 2500 developers to
add a new git hook to every repo that they do something with would be a
bit of a disaster. When you combine that with the people who won't know,
will make a patch, send it up, and have it rejected --- oy. Chaos.

git review is used by a ton of people who write in non-python. I think
adding openstack-specific style enforcement to it would make it way less
generally useful.

In general, if you find it interesting, there's certainly nothing wrong
with tracking it and poking at it from time to time. But I honestly
think that the logistical issue is pretty large, and one that the payoff
from solving would not be worth the effort.


More information about the OpenStack-dev mailing list