google / vulncode-db

Vulncode-DB project
https://www.vulncode-db.com
Apache License 2.0
575 stars 71 forks source link

Coding style #6

Closed 3wnbr1 closed 5 years ago

3wnbr1 commented 5 years ago

Coding style

evonide commented 5 years ago

One more remark regarding this PR. If we want to keep it pep8 compliant: https://www.python.org/dev/peps/pep-0008/#maximum-line-length the recommendation is to use a maximum line length of 79 characters vs. the 128 characters default that this PR would introduce. In my humble opinion, we should choose and fully adhere to one standard guideline such as pep8. What do you think?

3wnbr1 commented 5 years ago

Personally, I don't use E501 (the 79 characters limit) when applying PEP8 codestyle. I think it is a bit outdated nowadays as screens are getting wider and wider and worsen code readability. I understand it is a bit controversial, but you wouldn't make me any offense if you choose to apply E501. About that, do you have any best practises at Google ?

evonide commented 5 years ago

Thanks a lot for addressing the issues Ewen :)!

The official Google Python style guide is here http://google.github.io/styleguide/pyguide.html#32-line-length saying "Maximum line length is 80 characters.". The thing with style guides is that there most of the time will be something that one personally doesn't like. However, the good thing is that they are usually used in a consistent way making it straightforward to read code of others. Accordingly, I would prefer if we stick to the official PEP8 styleguide and E501 which is commonly used throughout open source Python projects.

3wnbr1 commented 5 years ago

Thanks @evonide . With that in mind, I updated the yapf settings to fully adhere to PEP8 and especially E501. I additionaly intended properly few docstrings. Looking good now 😃

evonide commented 5 years ago

Awesome thank you very much for addressing all issues and for the work on this Ewen!