💾 Archived View for freedombone.net › blog › static-analysis-for-epicyon.gmi captured on 2020-11-07 at 00:40:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2020-09-24)

-=-=-=-=-=-=-

static analysis for epicyon

Recently I discovered a bug in Epicyon [1] 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 [2], 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.

[1] Epicyon

[2] flake8