What are the comprehensive checksums for Python?

I heard that there are several tools that allow you to check the code for common Python errors, such as pylint and pyflakes. I am looking for a comprehensive, correct and easy to integrate into the assembly (setup.py is desirable or buildbot, if necessary).

Which one do you recommend and why?

+85
python lint
Apr 10 2018-11-12T00:
source share
2 answers

For Python, there are several programs like lint:

  • pyflakes - parses, great for searching for NameErrors, legacy imports
  • pylint - analyzes, very comprehensive (on the overly compulsive side).
  • pep8 - analyzes, checks the style.
  • flake8 - parser, combines pep8 and pyflakes, with additional support for complexity, extensible.
  • pychecker - running (be careful)

All helped me find small problems and have my pros and cons. It is also discussed here.

+130
Oct 28 '11 at 5:08 a.m.
source share

This question is too broad, so I just listed my FWIW toolchain.

Editing

emacs + python-mode + flymake + ropemacs.

flymake starts the process as the file is edited, the process can be any. I have a flymake configured to burn pyflakes and pep8. Therefore, I get directions in the pep8 file for violations, syntax errors, unused imports, variables declared but not used, etc.

the rope is convenient for jumping with announcements and a bit of automatic completion. It will also show you the signatures of documents and functions, etc.

I'm sure there are similar things for vim. And although my colleague failed to launch it, they told me that the wing can use pyflakes and pep8.

Testing

nose + various plugins. In my emacs, I bind F7 (compilation) to run the nose, this way I get a buffer where I can go to errors and then go to that line in the source code.

version control

I am using mercurial.

dependencies

buildout or virtualenv or both. Depending on the project. Use what works best for your project. I met buildout because now I am developing an application for the application, and I prefer recipes in buildout for the appendine application structure for the appengine monkey approach, but that's just me.

If I were not developing the application, I would probably stick with virtualenv.

continuous integration

jenkins is the easiest i have ever set up. it basically runs the same tests that I use in my compilation team, but also generates a coverage report.

I think that realizing that there, and the ability to completely change all your needs in the project you are working on, is better than looking for the "best of breed" solution, mainly because the best of breed solution simply doesn’t exist.

+14
Apr 10 2018-11-18T00:
source share



All Articles