Kindev / fundraisee-api

:moneybag: Open source fundraising platform RESTful API
2 stars 6 forks source link

Add python code formatter #11

Open endiliey opened 6 years ago

endiliey commented 6 years ago

What is this issue about

In javascript project, we usually use prettier to format our code. So we don't have to worry about spaces, indentation, unconsistent code style :)

I think it's good to use some python code formatter. I think https://github.com/ambv/black is a good choice. Black makes code review faster by producing the smallest diffs possible

Other possible code formatter and a good read: https://medium.com/3yourmind/auto-formatters-for-python-8925065f9505

michjk commented 6 years ago

For me, I set my editor to follow standard python space which is 4 spaces. If we follow this standard we may not need code formatter. But it is still good to have formatter.

endiliey commented 6 years ago

There is a lot of stuff like max-line-length, trailing commas, empty lines, etc.

I think it's good to add hahaha

michjk commented 6 years ago

Maybe we can use black. I just set vscode to use black and it workes fine. Not sure for linter, but I get unnecessary error for pylint. image

michjk commented 6 years ago

Note, Python 3.6 is needed. For ubuntu 14 or 16.04, need to download from different repository.

endiliey commented 6 years ago

Yup because black doesnt care for pep8, etc. See our readme ? 3.6 only 😂

michjk commented 6 years ago

Damn 😂