pyre2
pyre2 copied to clipboard
flake8 and coverage.py syntax errors
eg:
src/re2.pyx:106:9: E999 SyntaxError: invalid syntax
This didn't happen with older flake8 versions; the coverage thing is new. There are some issue/so discussions about cython and coverage.py and projects using the src/
layout. That last bit is usually src/<name>
and isn't (by itself) a problem, except the cython coverage plugin apparently gets confused with includes and src/
without any __init__.py
etc. :/
I'll keep looking but for now coverage is not working and flake8 config has E999 added to ignore list.
Update 1:
Turns out flake8 was an upstream red-herring since version 4 stops doing anything if the AST check fails, thus the (new) E999 warning and no additional output. Falling back to flake8<4 produces the expected indenting and other misc warnings. Sadly there is no official support for linting cython source that I know of, at least from the flake8 authors.
Update 2:
Although the latest cython (pre) releases do claim coverage support for src/
package layout, coverage.py and/or the cython.coverage plugin are still broken on the includes in this project. I still need to file an upstream bug and test an idea or two (pending feedback on the bug).
re update 2: if it makes life easier, let's rename src to re2 ? these tools expect the directory to have the same name as the module, right? Or is a package required as well?
Sadly there is no official support for linting cython source that I know of, at least from the flake8 authors.
Sorry for the self-promo, but may I suggest trying out cython-lint? It parses the Cython AST directly, and implements many of the same checks