2018-01-22 11:41, Ivan Kanakarakis wrote:
Hi all,
flake8[0] is a wrapper that is enforcing a coding style using PEP8,
and additionally does code analysis using pyflakes to catch bugs (eg
undeclared variables) or leftovers (eg unused variables). It
integrates well with different IDEs and also with the Syntastic vim
plugin[1]. This article[2] goes into some details about flake8, PEP8
and pyflakes.
I would strongly recommend to start using flake8 and progressively
make style-changes to the code.
SOLID is not related to coding style directly, but more to the
principles which form a program structure - how interfaces are built,
how components are separated, etc
PS: I haven't looked into google's styleguide yet.
[0]:
http://flake8.pycqa.org/en/latest/manpage.html
[1]:
https://github.com/vim-syntastic/syntastic
[2]:
https://blog.sideci.com/about-style-guide-of-python-and-linter-tool-pep8-py…
Cheers,
It might also be a good idea to use Bandit[1] (static analyzer from the
OpenStack Security Group) to clean up some of the existing code and to avoid
common security related issues in the future.
I've tested it against some of the codebases in our community and found room
for improvement, while the false positives were relativity low (and it is easy
to simply append # nosec to any lines of code that triggers a false positive).
[1]
https://github.com/openstack/bandit
Best regards,
John