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

2015-03-31 Thread Robert Collins
On 28 March 2015 at 00:21, Sean Dague  wrote:
> On 03/26/2015 06:46 PM, Robert Collins wrote:
...
>> Once everything is covered, and we're dealing with commits that change
>> things async (via the job above), then we can talk about how to help
>> developers submit code using it in the first place.
>
> Honestly, is there a problem here that really needs to be solved? I've
> been a little confused about this thread because I thought we're all
> actively calling people out for nit picking irrelevant style issues.

These things aren't incompatible.

The benefit of consistent code formatting is fairly well documented -
we learn how to read code more quickly and efficiently if its
consistently presented (and research is ongoing into what presentation
forms work best, but thats a different discussion).

We've decided - and I think its clearly true - that we were spending a
lot of effort to achieve this consistency in presentation, and that
its benefits, while real, were not worth the costs - latency on code
landing, additional testing, frustration, and worst of all
back-and-forths on minutiae.

> I feel like building a large system to avoid not being human to each
> other as completely dysfunctional.

Thats really framing the discussion oddly.

I'd frame it like this: there is this thing that computer could do for
us (formatting code), which brings undisputed benefits, should we make
the computers do it.

We have three choices:
 - don't have the thing (or have it sporadically)
 - have the thing with human enforcement (ugh, no, and we've concluded
we're not willing to do it that way)
 - have it via automation (this discussion)

-Rob

-- 
Robert Collins 
Distinguished Technologist
HP Converged Cloud

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-29 Thread Monty Taylor
On 03/27/2015 07:21 AM, Sean Dague wrote:
> On 03/26/2015 06:46 PM, Robert Collins wrote:
>> On 27 March 2015 at 09:14, Ryan Brown  
>> wrote:
>> 
>>> Ooof, that's huge. If we can configure it to be less
>>> aggressive I love the *idea* of having everything formatted
>>> semantically, but that's a pretty major burden for everyone
>>> involved.
>> 
>> It's huge today. It wouldn't be if we did it :).
>> 
>> I suggest that given the other aspects of our code review
>> system, we might treat this like translations as a long term
>> thing - that is setup a job somewhere to run the autoformatter
>> against trunk and submit the result as a patchset.
>> 
>> To get over the initial hump, I'd have a human break the patch
>> up into per-file changes or some such.
>> 
>> A variation would be to have a config file saying which files are
>> covered, and slowly dial that up, one file at a time.
>> 
>> Once everything is covered, and we're dealing with commits that 
>> change things async (via the job above), then we can talk about 
>> how to help developers submit code using it in the first place.
> 
> Honestly, is there a problem here that really needs to be solved? 
> I've been a little confused about this thread because I thought 
> we're all actively calling people out for nit picking irrelevant 
> style issues.
> 
> I feel like building a large system to avoid not being human to 
> each other as completely dysfunctional.
> 
> In the Nova tree we have many cross cutting efforts that need to 
> touch a lot of things (v3 renames, mox -> mock). This seems like 
> giant churn for no real gain.
> 
> I'm not convinced the answer to white space fights is a tool. I 
> think it's stop being silly, actively call out cores when they
> are, and actively call out new folks that it is completely
> unhelpful in the reviewing (and only going to raise ire of core
> teams, not ingratiate yourself).

++


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-27 Thread Sean Dague
On 03/26/2015 06:46 PM, Robert Collins wrote:
> On 27 March 2015 at 09:14, Ryan Brown  wrote:
> 
>> Ooof, that's huge. If we can configure it to be less aggressive I love
>> the *idea* of having everything formatted semantically, but that's a
>> pretty major burden for everyone involved.
> 
> It's huge today. It wouldn't be if we did it :).
> 
> I suggest that given the other aspects of our code review system, we
> might treat this like translations as a long term thing - that is
> setup a job somewhere to run the autoformatter against trunk and
> submit the result as a patchset.
> 
> To get over the initial hump, I'd have a human break the patch up into
> per-file changes or some such.
> 
> A variation would be to have a config file saying which files are
> covered, and slowly dial that up, one file at a time.
> 
> Once everything is covered, and we're dealing with commits that change
> things async (via the job above), then we can talk about how to help
> developers submit code using it in the first place.

Honestly, is there a problem here that really needs to be solved? I've
been a little confused about this thread because I thought we're all
actively calling people out for nit picking irrelevant style issues.

I feel like building a large system to avoid not being human to each
other as completely dysfunctional.

In the Nova tree we have many cross cutting efforts that need to touch a
lot of things (v3 renames, mox -> mock). This seems like giant churn for
no real gain.

I'm not convinced the answer to white space fights is a tool. I think
it's stop being silly, actively call out cores when they are, and
actively call out new folks that it is completely unhelpful in the
reviewing (and only going to raise ire of core teams, not ingratiate
yourself).

-Sean

-- 
Sean Dague
http://dague.net



signature.asc
Description: OpenPGP digital signature
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Robert Collins
On 27 March 2015 at 09:14, Ryan Brown  wrote:

> Ooof, that's huge. If we can configure it to be less aggressive I love
> the *idea* of having everything formatted semantically, but that's a
> pretty major burden for everyone involved.

It's huge today. It wouldn't be if we did it :).

I suggest that given the other aspects of our code review system, we
might treat this like translations as a long term thing - that is
setup a job somewhere to run the autoformatter against trunk and
submit the result as a patchset.

To get over the initial hump, I'd have a human break the patch up into
per-file changes or some such.

A variation would be to have a config file saying which files are
covered, and slowly dial that up, one file at a time.

Once everything is covered, and we're dealing with commits that change
things async (via the job above), then we can talk about how to help
developers submit code using it in the first place.

-Rob


-- 
Robert Collins 
Distinguished Technologist
HP Converged Cloud

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Ryan Brown
On 03/26/2015 02:15 PM, Kiall Mac Innes wrote:
> I have no clue how I managed to send that last email encrypted -
> Apologies :)
> 
> Re YAPF, or autofomatting, I've very little opinion..
> 
> But - I gave YAPF a go against the Designate codebase with the stock config:
> 
>   258 files changed, 5242 insertions(+), 5691 deletions(-)
> 
> Getting changes like that into the various projects won't be easy, even
> if the core team is happy to just +A without reviewing for potential
> issues, a massive percentage of in-progress reviews will fail to merge
> and need manual rebasing.
> 
> For companies with internal forks/patches - those will likely all have
> to be redone too..

Ooof, that's huge. If we can configure it to be less aggressive I love
the *idea* of having everything formatted semantically, but that's a
pretty major burden for everyone involved.

-- 
Ryan Brown / Software Engineer, Openstack / Red Hat, Inc.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Kiall Mac Innes
I have no clue how I managed to send that last email encrypted -
Apologies :)

Re YAPF, or autofomatting, I've very little opinion..

But - I gave YAPF a go against the Designate codebase with the stock config:

  258 files changed, 5242 insertions(+), 5691 deletions(-)

Getting changes like that into the various projects won't be easy, even
if the core team is happy to just +A without reviewing for potential
issues, a massive percentage of in-progress reviews will fail to merge
and need manual rebasing.

For companies with internal forks/patches - those will likely all have
to be redone too..

I'm not sure there's really a good solution to this

Thanks,
Kiall


On 26/03/15 16:38, Kiall Mac Innes wrote:
> 
> 
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Maru Newby

> On Mar 25, 2015, at 4:22 PM, Monty Taylor  wrote:
> 
> 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.

I agree with points raised by you and jeblair regarding the
potential for problems in applying auto-formatting without
developer intervention.  I apologize if my use of the word
'automation' muddied the waters, as the go codereview tool's
support of the 'gofmt' command is limited to explicit invocation
rather than being triggered in a hook.  It doesn't appear
acceptable for git-review to be granted similar capability, but
really that is a nicety.  Individual projects can as easily
provide their own style definitions, include YAPF as a test
dependency, and document how to invoke it.

I think there is value in extending our current solution of
automated style enforcement to provide a component that can be
manually invoked to auto-format to the enforced style.  I don't
see virtue in applying manual effort to maintaining code style.
YAPF may not be ready for our use just yet, but I think it's
worth pursuing. 


Maru


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Kiall Mac Innes


binv2ijTsg9Fd.bin
Description: PGP/MIME version identification


encrypted.asc
Description: OpenPGP encrypted message
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Chmouel Boudjnah
On Thu, Mar 26, 2015 at 5:02 PM, James E. Blair  wrote:

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


Sure, but  is that really make a difference between having some scripts in
a tox.ini that are run with tox -e or a script launched by git-review as
pre submit to git ?

Chmouel
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread James E. Blair
Chmouel Boudjnah  writes:

> On Thu, Mar 26, 2015 at 12:22 AM, Monty Taylor  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.

-Jim

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-26 Thread Chmouel Boudjnah
On Thu, Mar 26, 2015 at 12:22 AM, Monty Taylor  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
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-25 Thread Monty Taylor
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.

Monty

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-25 Thread Joshua Harlow

Unsure, I've always been iff on auto-tools like that.

Especially with things like: https://github.com/google/yapf/issues/10

But maybe in time...

IMHO the hacking rules aren't that much to learn and are good to know 
anyway.


-Josh

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]?

Cheers,


Maru

1: https://github.com/google/yapf
2: https://godoc.org/golang.org/x/review/git-codereview#hdr-Gofmt
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-03-25 Thread Maru Newby
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]?

Cheers,


Maru

1: https://github.com/google/yapf
2: https://godoc.org/golang.org/x/review/git-codereview#hdr-Gofmt
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev