Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running pep8 or pylint on cython code

Is there any way to use pep8 with cython files?

pep8 does not work with operators for example.

getline(& line)

produces error:

E225 missing whitespace around operator

Now if i try to fix it and run this:

getline( & line)

produces error:

 E201 whitespace after '('
like image 531
Michael WS Avatar asked Jul 07 '15 13:07

Michael WS


People also ask

Does Pylint enforce PEP8?

By default, Pylint will enforce PEP8-suggested names.

Is PEP8 a linter?

Pycodestyle (Formerly PEP8) is the official linter tool to check the python code against the style conventions of PEP8 python. To install it: pip install pycodestyle .

What is good Pylint score?

In python, the most consensual writing style is defined by the PEP-8 standard, which the popular pylint package enforces. It comes with a handy metric, the Pylint score: you get a 10/10 for perfectly conforming to the standard, less it you stray from it.

Which of the following modules warn about pp8 inconsistencies present in a python script?

pep8 warn about 8-space indent.


1 Answers

The neural network library Chainer has a pretty handy flake8 config for Cython:

[flake8]
filename = *.pyx,*.px*
exclude = .eggs,*.egg,build
ignore = E901,E225,E226,E227
like image 194
Kamil Sindi Avatar answered Sep 27 '22 18:09

Kamil Sindi