Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-10-07 Thread Kaxil Naik
Yup, I have a Draft PR already, once the Scheduler HA and the Task Instance Endpoints PRs are merged, I will rebase that PR. On Wed, Oct 7, 2020 at 8:00 PM Tomasz Urbaszek wrote: > As we are close to releasing 2.0 alpha it seems feasible to resurrect this > thread. > > I think we should run blac

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-10-07 Thread Tomasz Urbaszek
As we are close to releasing 2.0 alpha it seems feasible to resurrect this thread. I think we should run black on 2.0 as the last commit before releasing it. I would even argue that it should be done for alpha release. What do others think? Bests, Tomek On 2020/06/27 22:51:04, Ash Berlin-Tay

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-12 Thread Jarek Potiuk
Cool. I will try to make some tests with several open PRs how rebasing works with and I think if we find it easy, I am all for merging it asap. On Sun, Jul 12, 2020 at 2:01 AM Kaxil Naik wrote: > Updated the PR and added "skip-string-normalization = true" flag > > On Fri, Jul 10, 2020 at 8:36 AM

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-11 Thread Kaxil Naik
Updated the PR and added "skip-string-normalization = true" flag On Fri, Jul 10, 2020 at 8:36 AM Kaxil Naik wrote: > Awesome, thanks Jakob for the suggestion. Will update PR and we will keep > that in mind when rolling out the change :) > > On Fri, Jul 10, 2020 at 5:58 AM Jarek Potiuk > wrote:

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-10 Thread Kaxil Naik
Awesome, thanks Jakob for the suggestion. Will update PR and we will keep that in mind when rolling out the change :) On Fri, Jul 10, 2020 at 5:58 AM Jarek Potiuk wrote: > > 3. Everyone with open PRs rebases with git checkout --theirs -- which > keeps > > their pending changes > > > > I KNEW the

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-09 Thread Jarek Potiuk
> 3. Everyone with open PRs rebases with git checkout --theirs -- which keeps > their pending changes > I KNEW there must be the right git flag for that :). Happy to try this :) > 4. Everyone runs the autoformat (they won't go green until they do) > > Reference on checkout --theirs > https://how

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-09 Thread Jacob Ferriero
Regarding "can we do this with the right git flags": When Apache Beam community did something similar to standardize on "Spotless Java Everywhere" [BEAM-4394] they took the following approach

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-01 Thread Daniel Imberman
I think that once we add integration tests (which I’ll do now that we have helm for k8s) and we no longer have to back port this is a great idea. via Newton Mail [https://cloudmagic.com/k/d/mailapp?ct=dx&cv=10.0.50&pv=10.14.6&source=email_footer_2] On Wed, Jul 1, 2020 at 4:17 PM, Kaxil Naik wro

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-01 Thread Kaxil Naik
That sounds good. I will turn off String Normalization. On Thu, Jul 2, 2020 at 12:11 AM Daniel Standish wrote: > +1 no string normalization > > On Wed, Jul 1, 2020 at 3:20 PM Kamil Breguła > wrote: > > > Hello, > > > > I would also prefer to make this change after the release of Airflow 2.0. >

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-01 Thread Daniel Standish
+1 no string normalization On Wed, Jul 1, 2020 at 3:20 PM Kamil Breguła wrote: > Hello, > > I would also prefer to make this change after the release of Airflow 2.0. > > I would like to suggest that we use black without normalizing strings. In > my opinion, using two apostrophes in one file styl

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-07-01 Thread Kamil Breguła
Hello, I would also prefer to make this change after the release of Airflow 2.0. I would like to suggest that we use black without normalizing strings. In my opinion, using two apostrophes in one file style does not affect the readability of the code. On other hand, this can drastically reduce th

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-28 Thread Jarek Potiuk
Unfortunately it won't work this way (at least not by default) - the problem is that from what I could see (it's not very clear in the documentation), the 'pre-commit' hooks are only run on rebase or cherry-pick if there is a conflict - and only AFTER the conflict is resolved ( and --continue is us

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-28 Thread Kaxil Naik
Do we need a script though? They would only need to rebase their PR on master and the pre-commit hook will update their code with "black" too On Sun, Jun 28, 2020 at 3:53 PM Jarek Potiuk wrote: > And one more thing - such script/tool might be a nice tool to give for > people doing rebases of the

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-28 Thread Jarek Potiuk
And one more thing - such script/tool might be a nice tool to give for people doing rebases of their PRs from pre-black to post-black. This way we will make it easier for people to rebase their changes after black. I think it should simply take all the commits that we are reading and apply black fo

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-28 Thread Jarek Potiuk
Agree with Black and agree with Ash and Tomek about cherry-pickiness. .. But I also think this is the right time to do it. After 1.10.11 we will have some cherry-picks to do for 1.10.12 undoubtedly. However I presume we will be much closer to releasing 2.0 and we will not cherry-pick any of the pa

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-28 Thread Tomasz Urbaszek
This is a good idea, and for new code in Airflow I usually use black. However, I agree with Ash that this can make cherrypicking harder even if we run black on v1-10-test branch (there are already differences in code). Personally I would be in favor of introducing black and other things (i.e. pyupg

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-27 Thread Ash Berlin-Taylor
Yes, to Black in principle. But (and this is a big but) no, not yet. Or not without testing how it affects our ability to cherry pick back to the release branch. (My default would be to assume it makes them harder/almost impossible and this should be the almost last thing we do before we releas

Re: [DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-27 Thread Philippe Gagnon
It's a good idea. It will make reading the codebase easier, and besides the whole Python ecosystem is slowly moving towards adopting this code style. I personally have been a fan ever since the project launched. With regards to open PRs requiring a rebase, it's an annoyance for sure but if we do

[DISCUSS] Enable 'Black' for Auto Code Formatting

2020-06-27 Thread Kaxil Naik
Hi all, I would like to open the discussion to enable Black ( https://github.com/psf/black) - *The Uncompromising Code Formatter* for automatic formatting of Airflow's entire codebase. I have created a WIP PR at https://github.com/apache/airflow/pull/9550 Some of the caveats: - All the curre