Experience with black formatting in django

102 views
Skip to first unread message

Tom Aldcroft

unread,
May 17, 2022, 1:44:08 PM5/17/22
to Django developers (Contributions to Django itself)
The astropy project is currently considering implementing code formatting with black, much as Django did in 2019. I was happy to see the case for transitioning to black formatting in Django DEP-0008 (https://github.com/django/deps/blob/main/final/0008-black.rst). I think it captures the key points both pro and con, along with the inevitable lack of complete consensus in a large project.

My goal in writing is to request feedback from Django developers about how this transition has impacted django development and community engagement in the three years since the transition. 

Has there been specific feedback from contributors (both experienced and new) related to black autoformatting?
  • Ease of actually running black and meeting the black-format standard for PRs. Have there been technical problems that required assistance?
  • Style considerations?
Have most core developers accepted or embraced the black style at this point? The DEP included some testimonials to that effect, but some of us wondered if those represented a fair sampling of the community.

Are there any regrets or things you would change?

Do you have any advice for the astropy project?

Any feedback from your experience would be most appreciated.

Regards,
Tom (@taldcroft on GitHub)

Adam Johnson

unread,
May 18, 2022, 4:29:13 PM5/18/22
to Django developers (Contributions to Django itself)
Hi!

Although the DEP for Black was written several years ago, we only actually adopted it in the code base in February this year. The DEP determined to use Black when it was no longer beta, and that took a while :)

I think the reformatting was fairly popular, many people have given positive reactions on the PR: https://github.com/django/django/pull/15387 . My impression is there's only a minority who dislike Black, and often only one thing like the choice of double quotes.

The fellows (Carlton and Mariusz) do most of the day-to-day work, and they would have a better view on whether there has been any friction with new or returning contributors. I know that rebasing the existing branches was a bit of work, but one off.

Personally I adopted Black across the open source projects I maintain years ago, and haven't had any problems. I use pre-commit and pre-commit.ci to run Black and automatically reformat PR's. This means even contributors don't need to run it locally.

My advice would be to adopt :)

All the best,

Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/33b9a27e-2a0c-4e7c-ba2b-c5072a87073an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages