Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

RFC: Thoughts on Black? #127

Closed
itsthejoker opened this issue Jun 25, 2018 · 5 comments
Closed

RFC: Thoughts on Black? #127

itsthejoker opened this issue Jun 25, 2018 · 5 comments
Labels
RFC Request for Comments

Comments

@itsthejoker
Copy link
Member

https://github.com/ambv/black

This has crossed my dashboard more than once recently and every time it does, it looks more interesting. I'm curious to know what thoughts people have on adopting the Black code style for our projects.

@itsthejoker itsthejoker added the RFC Request for Comments label Jun 25, 2018
@itsthejoker
Copy link
Member Author

Comment from @TheLonelyGhost: "I'd have to toy with it a bit, but it looks like something very useful if for no other reason than uniformity of the source code."

I'll run Black against the current codebase and open it as a PR so we can see what we're looking at.

@itsthejoker itsthejoker mentioned this issue Jun 27, 2018
@TheLonelyGhost
Copy link
Member

Yeah, I don’t mind the changes and it takes the thinking of how to best format the code completely out of the equation. I really like that.

The only thing that throws me off is the emphasis on instead of for strings. Other languages use strings to protect from string interpolation and character escapes like \n. That’s not so much the case in python, I realize, and it will likely just be an adjustment period for me.

All things said, I’m in favor of it. We just need to map out using black with Flake8 or PyLint. Plus running that stuff as part of TravisCI or other CI pipeline is an item on my to do list. Hosted style solutions like Codacy just aren’t cutting it for me.

@itsthejoker
Copy link
Member Author

I agree -- this is the section on their justification for it: https://black.readthedocs.io/en/stable/the_black_code_style.html#strings

@DavidArchibald
Copy link
Contributor

I've been using Black for a while now, largely inspired by this issue. I did not comment on it then because I had had no experience in it. However, I'd now like to report that since then I've come across no issues with using it in my personal projects. I've quite enjoyed how it formats everything for me, eliminating some of the more tedious, repetitive work. Even better, Black is fast enough that I was able to hook it up to format the file every time I save it, so I don't have to stare at ugly code for too long, or switch from writing code to run it. I think adding it to the Repo, or really any style guide will be beneficial because it will prevent styles from conflicting. I opened #145 for some of the small style problems I noticed to alleviate this, but Black should eliminate this problem entirely.

@TheLonelyGhost
Copy link
Member

@itsthejoker I think this RFC has been open for long enough. Sounds like there aren't any arguments against, so let's do it!

Ape saying 'Go!'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
RFC Request for Comments
Projects
None yet
Development

No branches or pull requests

3 participants