gtfspy icon indicating copy to clipboard operation
gtfspy copied to clipboard

Add pre-commit configuration (Black)

Open evelyn9191 opened this issue 4 years ago • 3 comments

evelyn9191 avatar Mar 07 '20 07:03 evelyn9191

The first part of the pre-commit PR. @rkdarst

evelyn9191 avatar Mar 07 '20 07:03 evelyn9191

So, about this... while these days I see some benefit of strict code formatting (I didn't before, and still wouldn't necessarily use it for my projects), after thinking more I don't feel fully comfortable taking it into use in this project if I'm basically watching it for someone else, who may start working on it later this year.

What do you think? I hope this is OK. Any other improvements I would like, and we should try to get a release out...

rkdarst avatar Mar 22 '20 21:03 rkdarst

I think that when more people contribute to the code (which, given that this is an open-source library, we can expect people to do), it is very helpful to keep it clean, readable and reusable.

I can understand the reasons against more strict formatters that won't let you pass until you fix the issue, such as mypy or flake8, I don't see Black as an obstruction - it is an automatic formatting tool. Once you run pre-commit install, you don't really have to do anything else - when set up correctly, it will format your code before you commit and you don't need to do anything extra. The point of Black is to let you write the code as you want, without worrying about any formatting because it does it for you automatically. So whereas I get the reasons for not accepting the above mentioned formatters, I don't quite follow the reasons behind not accepting this PR.

evelyn9191 avatar Mar 24 '20 18:03 evelyn9191