Cython Lint

0.19.0 · active · verified Mon Apr 13

cython-lint is a powerful static analysis tool and pre-commit hook designed to lint Cython files. It extends the capabilities typically found in Python linters like flake8 to the Cython language, helping developers maintain code quality and catch common pitfalls. The current version is 0.19.0, with a release cadence of several minor versions per year.

Warnings

Install

Imports

Quickstart

To quickly lint a Cython file from the command line, create a `.pyx` file and run `cython-lint` against it. This example demonstrates detection of an unused variable and an 'always true' tuple condition.

echo "def foo():\n    x = 1 # unused variable\n    if (1,): pass # always true tuple condition\n    l = []\n    l.append(1)" > my_module.pyx
cython-lint my_module.pyx

view raw JSON →