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

James E. Blair corvus at inaugust.com
Thu Mar 26 16:02:23 UTC 2015

Chmouel Boudjnah <chmouel at chmouel.com> writes:

> On Thu, Mar 26, 2015 at 12:22 AM, Monty Taylor <mordred at inaugust.com> wrote:
>> 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.
> I think if we wanted to do that we could just extend git-review run_scripts
> thing[1] to read tox.ini or other shipped with the project file to run the
> pre-review script from it.
> Chmouel
> PS: I haven't looked at yapf so i have not much opinion about it.
> [1]
> https://git.openstack.org/cgit/openstack-infra/git-review/tree/git_review/cmd.py?h=master#n229

An important thing to note about the git-review hooks is that they _very
deliberately_ do not automatically run anything in the repo.  You must
specifically add a git-review hook to your local checkout or to your
home directory in order for it to run.

This is purposefully done to ensure that developers do not inadvertently
run code on their workstations from a source they may not trust.

So yes, it would be very simple to configure git-review to run this on
patch upload.  But it still needs to be a choice each developer makes.


More information about the OpenStack-dev mailing list