Present Perfect


Picture Gallery
Present Perfect

For the love of Pychecker

Filed under: General — Thomas @ 18:03


Spent way too much time today poking at problems pychecker was reporting on Flumotion. The problem with most code checkers is that they often report problems in code you don't care about because it's beyond your control, and that once in a while you want to do explicitly allow a specific instance of a bad thing Just This Once. The usefulness of the tool is directly related to the granularity with which you can enable or disable checks for specific objects, from small functions to complete modules.

After fixing a few easier problems, I again got the eerie sensation that pychecker was not reporting all the problems it should. I would run pychecker on less files than a standard make check does, and get more warnings. Paradoxically quixotic. The problem is it's kind of slow to reproduce, on my laptop, taking a few minutes to run pychecker, so playing with the file arguments to see where it went wrong was a little time-consuming. When chasing bugs, it always pays off to spend some time poking at the Black Box and taking your Diamond Saw of Perception and shave off chunks of the box. Try to find the simplest test case that reproduces the problem.

At some point I noticed that it was not necessarily the contents of the file that caused warnings to go away - I renamed a file to something else and suddenly it did show all the warnings when checking that newly named file. That finally gave me the last clue I needed to find the most minimal test case.

Since seeing is believing, I've written a third-millenium play that explains the bug. All you need to do is:

svn co https://thomas.apestaart.org/thomas/svn/tests/pychecker/order; cd order; make

For the lazy ones, I've had Zaheer make me a screencast:

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.