[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Charles R Harris
On Sun, May 8, 2022 at 10:30 AM Joshua Wilson wrote: > As someone who worked on a project that used to use yapf, a word of > caution - regardless of quality of formatting versus black, it generally > has not had the resources to keep up with new releases of Python. See > > https://github.com/goog

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Juan Nunez-Iglesias
On Sun, 8 May 2022, at 7:11 AM, Sebastian Berg wrote: > To be fair to black, the main issue there is the trailing `,` which > forces items to be formatted on a line each (yapf does the same). > If you remove the trailing comma, you will get close to what you want > also in black: > > custom

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Joshua Wilson
As someone who worked on a project that used to use yapf, a word of caution - regardless of quality of formatting versus black, it generally has not had the resources to keep up with new releases of Python. See https://github.com/google/yapf/issues/772 https://github.com/google/yapf/issues/993 htt

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Evgeni Burovski
Mind sharing your yapf config Juan? вс, 8 мая 2022 г., 08:40 Juan Nunez-Iglesias : > With the caveat that I am just an interested bystander, I would like to > point back to yapf as an alternative. I agree with what has already been > echoed by the majority of the community, that setting *some* a

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Sebastian Berg
On Sat, 2022-05-07 at 22:37 -0700, Juan Nunez-Iglesias wrote: > With the caveat that I am just an interested bystander, I would like > to point back to yapf as an alternative. I agree with what has > already been echoed by the majority of the community, that setting > *some* auto-formatter is a hug

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-07 Thread Juan Nunez-Iglesias
With the caveat that I am just an interested bystander, I would like to point back to yapf as an alternative. I agree with what has already been echoed by the majority of the community, that setting *some* auto-formatter is a huge benefit for both review and writing sanity. I very much disagree

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-07 Thread Peter Cock
On Fri, May 6, 2022 at 4:59 PM Charles R Harris wrote: > > Heh. I think automatic formatting is the future and was happy to see the > PR. The only question is if black is the way we want to go. IIRC, the main > sticking points were > >- Line length (<= 79). >- Quotation mark changes (nois

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-06 Thread Charles R Harris
On Fri, May 6, 2022 at 2:10 AM Sebastian Berg wrote: > On Thu, 2022-05-05 at 15:32 -0700, Stefan van der Walt wrote: > > On Thu, May 5, 2022, at 12:00, Trevor Gross wrote: > > > I don't necessarily know that this should be enforced on CI off the > > > bat (though in the future it could be), but a

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-06 Thread Pamphile ROY
Hi, By running `pre-commit install` you are registering the hook directly into the .git folder of the project. So no matter if you have an env activated or not it works. Behind the scene, pre-commit uses it's own virtual env to run the hooks. This is why typically it's just used for static anal

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-06 Thread Sebastian Berg
On Thu, 2022-05-05 at 15:32 -0700, Stefan van der Walt wrote: > On Thu, May 5, 2022, at 12:00, Trevor Gross wrote: > > I don't necessarily know that this should be enforced on CI off the > > bat (though in the future it could be), but at least having the > > tool available and easily usable would h

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-06 Thread Matti Picus
On 6/5/22 09:09, Stefan van der Walt wrote: Hi Matti, On Thu, May 5, 2022, at 22:08, Matti Picus wrote: This somehow runs when I do "git commit"? Do I need to add anything to my git environment to pick up the hook? How do I turn it off if I find it prevents progress or breaks? Do we need to ad

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-05 Thread Stefan van der Walt
Hi Matti, On Thu, May 5, 2022, at 22:08, Matti Picus wrote: > This somehow runs when I do "git commit"? Do I need to add anything to > my git environment to pick up the hook? How do I turn it off if I find > it prevents progress or breaks? Do we need to add anything to the > documentation to wa

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-05 Thread Matti Picus
On 6/5/22 01:32, Stefan van der Walt wrote: On Thu, May 5, 2022, at 12:00, Trevor Gross wrote: I don't necessarily know that this should be enforced on CI off the bat (though in the future it could be), but at least having the tool available and easily usable would help to incrementally improv

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-05 Thread Stefan van der Walt
On Thu, May 5, 2022, at 12:00, Trevor Gross wrote: > I don't necessarily know that this should be enforced on CI off the bat > (though in the future it could be), but at least having the tool available > and easily usable would help to incrementally improve codebase style, and > remove the need