VirusTotal / vt-py

The official Python 3 client library for VirusTotal
https://virustotal.github.io/vt-py/
Apache License 2.0
531 stars 121 forks source link

Format the code with black #152

Closed za closed 1 year ago

za commented 1 year ago

To have a more standardized style (I know this is opinionated), what if we use black to format the python code?

za commented 1 year ago

Hi @mgmacias95 if you have time, do you have any opinion on this issue? #noturgent

mgmacias95 commented 1 year ago

Hello @za,

Sorry for taking this long to reply, I've been on PTO.

At Google we have an internal tool for code formatting. I think it's best we use that one instead of black. Let me update your PR with the changes done by that tool :).

Thanks!

za commented 1 year ago

Hi @mgmacias95 no worries.

BTW, I am just wondering, so pyformat (or Google internal tool) prefer to use two spaces instead of four spaces? It's quite surprising for me, as I am very familiar with four spaces style :-)

Eg: https://github.com/VirusTotal/vt-py/pull/158/commits/1a218fd94922a00271891028ad5d58a1de918771#diff-57858fdb2ea5f8ab13f838086dad0766251423dad1c83a5f3aea009dde63bba7R23

Oh, and I can see the module import is in alphabetical order now. Like what we can do with isort.

https://github.com/VirusTotal/vt-py/pull/158/commits/1a218fd94922a00271891028ad5d58a1de918771#diff-df4b50dbc0f85054b3b28a2094f13d5a1dcec8edd425306d88a44fa6c0ebcd79R21

mgmacias95 commented 1 year ago

Yes, we use two spaces and imports are sorted to they are easier to find.

I'm closing this issue since the PR is already merged.

za commented 1 year ago

Thanks for the review @mgmacias95 !