Freedombone Blog / Static Analysis for Epicyon

Recently I discovered a bug in Epicyon which was just a missing function argument, and since my background is with languages like C, where this sort of thing would be caught at compile time, I was thinking that there ought to be some static analysis tool to find bugs like this automatically. It turns out that there are a few for Python.

The tool I went with is flake8, which imposes a certain code style and also finds syntax errors, missing imports and other things. It's already packaged for Debian, and so this doesn't change the status of Epicyon as potentially being included within a pure blend.

While using flake8 other bugs were found, and they were mostly minor ones in lesser visited parts of the code. I've also added a script called static_analysis which runs flake8 on all the source files, apart from the unit tests.

So now I can have greater confidence that the code is doing some approximation of what it's supposed to be doing, without variable names with typos in them or missing imports.