A tool and pre-commit hook to lint Cython files.
$ pip install cython-lint
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.1.8
hooks:
- id: cython-lint
$ cython-lint my_file_1.pyx my_file_2.pyx
my_file_1.pyx:54:5: 'get_conversion_factor' imported but unused
my_file_2.pyx:1112:38: 'mod' defined but unused
Exclude lines by include a # no-cython-lint
comment (analogous to # noqa
in flake8
).
Currently, the following checks are implemented:
- variable defined but unused
- variable imported but unused
More to come! Requests welcome!