You can use cython-lint
Installation
$ pip install cython-lint
Usage as a pre-commit hook
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.10.1 # put most recent version here
hooks:
- id: cython-lint
- id: double-quote-cython-strings
Command-line example
$ 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
my_file_3.pyx:4:9: dangerous default value!
my_file_3.pyx:5:9: comma after base type in definition
pep8
is a code checker forpython
code.cython
is a different language. I don't think this is possible. – Totalityreference
or similar) provided by cython. – Chicory