django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

Added black configuration

Open webbyfox opened this issue 6 years ago • 10 comments

Added only black configuration as per @tomchristie request here https://github.com/encode/django-rest-framework/pull/6586.

webbyfox avatar Apr 30 '19 20:04 webbyfox

@tomchristie should we go ahead with the --skip-string-normalization argument?

rpkilby avatar May 01 '19 21:05 rpkilby

should we go ahead with the --skip-string-normalization argument?

I suggest to postpone this until a decision is made regarding DEP 0008 (PR django/deps#55, ML thread). It would be nice to follow the same formatting Django uses.

michael-k avatar May 02 '19 09:05 michael-k

Thanks for the link - excellent write up by Aymeric.

I would definitely value maintaining consistency with Django, however I'd also be interested in comparing the relative impact of black with and without string normalization. In part, because black will disrupt existing PRs, and disabling string normalization might significantly reduce that disruption.

rpkilby avatar May 03 '19 00:05 rpkilby

Do we really want black ?

xordoquy avatar Oct 06 '20 19:10 xordoquy

I know there is divided opinion on it.

For me I like the consistency, as I often forget hanging indentation or a trailing comma, which then takes time to both review and fix.

It would stop the need to review and merge pull requests like this, again protecting valuable time of all involved. (I'm not saying this shouldn't have been merged, rather that it would never have been created in the first place).

https://github.com/encode/django-rest-framework/pull/7539

smithdc1 avatar Oct 06 '20 20:10 smithdc1

I'm +1 on Black. I think DRF can be a bit more aggressive than Django on adopting it. It's still in beta but I've not seen any code formatting mistakes due to using it in just over a year using it on my closed and open source projects.

adamchainz avatar Oct 10 '20 16:10 adamchainz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 01 '22 05:05 stale[bot]

Black has now a stable release and it seems Django now also added black as of https://code.djangoproject.com/ticket/33476

It would be great to get this implemented in DRF as well.

sliverc avatar May 02 '22 05:05 sliverc

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '22 21:07 stale[bot]

Black has now a stable release and it seems Django now also added black as of https://code.djangoproject.com/ticket/33476

It would be great to get this implemented in DRF as well.

sliverc avatar Jul 30 '22 10:07 sliverc

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 01 '22 10:10 stale[bot]